diff --git a/AGENTS.md b/AGENTS.md index bbbf8e3..6bd32ff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,9 +55,11 @@ For both local and cloud commands, define the clap variant in the appropriate `c Typed Rust client library for the ClickHouse Cloud API. The library owns all OpenAPI interaction and all cloud integration testing. -- `src/client.rs` — `Client` struct with one async method per OpenAPI operation. -- `src/models.rs` — request/response types matching the spec (see Request and response models below). Model structs, enums and type aliases must live here; it is the only file the drift analyzer inventories. -- `src/convert.rs` — explicit response→request conversions. The analyzer does not parse it, so nothing declared here counts as a model. +- `src/client.rs` — `Client` and shared HTTP machinery; endpoint methods live in private per-domain `src/client/*.rs` files. +- `src/models.rs` — the public model facade and shared discriminated-union macro. Request/response structs, enums, aliases, and their implementations live in private per-domain `src/models/*.rs` files and are re-exported without changing the crate-root or `models::*` paths. +- `src/convert.rs` — `MissingRequiredFields` and conversion documentation; explicit response→request conversions live in private per-domain `src/convert/*.rs` files. + +The drift analyzer recursively traverses the private module trees rooted at `client.rs`, `models.rs`, and `meta.rs`. Model declarations remain literal source in that tree; declarations in conversion files do not count as models. The API library can be updated independently of the CLI. When OpenAPI drifts, prefer updating API library on its own, add to CLI separately. @@ -67,7 +69,7 @@ A response must never fail to deserialize because the API dropped a field, sent - **Request types are strict.** A field the spec requires is `T`; optional or nullable fields are `Option` plus `#[serde(skip_serializing_if = "Option::is_none")]`. The compiler is what enforces "strict in what we send". - **Response types are all-`Option`.** Every field of every type reachable from a `Client` return type is `Option` plus `skip_serializing_if`. A missing key *and* an explicit JSON `null` both land as `None`, natively — no attribute needed. Nothing is fabricated, so "the server sent `0`" and "the server dropped the field" stay distinguishable, and each caller resolves absence where it is used. -- **`#[serde(default)]` is banned in `models.rs`.** On a required request field it invents `""`/`0`/`false` that a get → edit → write-back caller silently persists; on an `Option` field it is dead weight. Sweeping it across every model field was the superseded policy of issues 312 and 313 — do not reintroduce it. +- **`#[serde(default)]` is banned in the model module tree.** On a required request field it invents `""`/`0`/`false` that a get → edit → write-back caller silently persists; on an `Option` field it is dead weight. Sweeping it across every model field was the superseded policy of issues 312 and 313 — do not reintroduce it. - **Unknown fields are ignored.** Never `deny_unknown_fields`. ##### Naming and the split @@ -82,7 +84,7 @@ Response types keep `derive(Serialize)` — `--json` and `print_human` serialize ##### Write-back conversions -Because the variants are distinct types, a caller that fetches a resource, edits it and writes it back must resolve absence explicitly — that is the point of the split, not an inconvenience of it. `src/convert.rs` owns those conversions: `TryFrom<{Name}Response> for {Name}` where a required request field can be absent, `From` where the conversion is total. A fallible one returns `MissingRequiredFields` (re-exported at the crate root; `.fields()` lists the missing **wire** names). Give each nested object its own conversion so a missing field is named at the level it is missing from, and reuse `MissingRequiredFields` rather than adding a second error type. +Because the variants are distinct types, a caller that fetches a resource, edits it and writes it back must resolve absence explicitly — that is the point of the split, not an inconvenience of it. The owning `src/convert/.rs` file contains those conversions: `TryFrom<{Name}Response> for {Name}` where a required request field can be absent, `From` where the conversion is total. A fallible one returns `MissingRequiredFields` (re-exported at the crate root; `.fields()` lists the missing **wire** names). Give each nested object its own conversion so a missing field is named at the level it is missing from, and reuse `MissingRequiredFields` rather than adding a second error type. ##### The residual, honestly @@ -90,7 +92,7 @@ A key that is *present* with a changed type still fails. `Option` absorbs abs ##### How the policy is enforced -`crates/clickhouse-cloud-api/tests/spec_coverage_test.rs` pins all of it against the analyzer's `response_tree()`, which derives response reachability from `client.rs` return types so a newly wired operation is covered automatically: +`crates/clickhouse-cloud-api/tests/spec_coverage_test.rs` pins all of it against the analyzer's `response_tree()`, which derives response reachability from return types across the client module tree so a newly wired operation is covered automatically: - `every_response_tree_field_is_option` — no non-`Option` field in the tree. Its exception list is empty; an entry needs the same bar as an analyzer exemption. A vacuity guard fails the test if the tree collapses. - `every_response_tree_option_field_omits_none_when_serialized` — `skip_serializing_if` on every response `Option` field. @@ -104,7 +106,7 @@ Scope enforcement to the response tree, never to "every model type": operation-u ClickHouse Cloud OpenAPI spec: https://api.clickhouse.cloud/v1 - `.github/workflows/openapi-drift.yml` runs `scripts/check-openapi-drift.py` daily. Python owns fetching, issue rendering, and GitHub orchestration only; `python3 scripts/check-openapi-drift.py --dry-run` reproduces the rendered issue without creating one. -- `crates/clickhouse-openapi-analyzer` is the single implementation of parsing and comparison. `rust_inventory.rs` walks and parses the module trees rooted at `client.rs`, `models.rs`, and `meta.rs` with `syn`; module cfg evaluation uses the analyzer host target, excludes `test`, treats feature-gated API as enabled, and conservatively retains unknown custom cfgs. `openapi.rs` inventories the target spec and vendored snapshot; `compare.rs` maps them and emits typed findings; `config.rs` owns ClickHouse-specific policy; `report.rs` defines the stable JSON/text report; `main.rs` is the executable used by Python. Do not duplicate source parsing, exemptions, or comparison logic in tests or Python. +- `crates/clickhouse-openapi-analyzer` is the single implementation of parsing and comparison. `rust_inventory.rs` recursively walks and parses private and public modules rooted at `client.rs`, `models.rs`, and `meta.rs` (including both `.rs` and `/mod.rs`) with `syn`; module cfg evaluation uses the analyzer host target, excludes `test`, treats feature-gated API as enabled, and conservatively retains unknown custom cfgs. `openapi.rs` inventories the target spec and vendored snapshot; `compare.rs` maps them and emits typed findings; `config.rs` owns ClickHouse-specific policy; `report.rs` defines the stable JSON/text report; `main.rs` is the executable used by Python. Do not duplicate source parsing, exemptions, or comparison logic in tests or Python. - The analyzer is private (`publish = false`) and a dev dependency of `clickhouse-cloud-api`. Parser/tooling dependencies such as `syn` must not enter either published crate's normal dependency graph. - `crates/clickhouse-cloud-api/tests/spec_coverage_test.rs` analyzes the vendored snapshot; its ignored test analyzes the live spec. Both and the scheduled workflow call the same analyzer and must agree. @@ -115,11 +117,11 @@ Work from the issue's typed findings. `spec_pointer` is an RFC 6901 location in 1. Reproduce with `python3 scripts/check-openapi-drift.py --dry-run`. The command does not update the snapshot. 2. Replace `crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json` with the same live document being remediated; do not hand-edit the spec. Snapshot operation/schema findings mean this file is stale. 3. Fix the API library before considering CLI exposure. Follow the finding's pointer and Rust item: - - Missing/extra operations: add or remove the corresponding `Client` method in `client.rs`; only intentional non-OpenAPI helpers belong in `non_openapi_client_methods`. - - Missing models, fields, or extra fields: update public structs/enums/type aliases and Serde names in `models.rs`. An undefined `$ref` (`missing_schema_definition`) is an upstream-spec defect, not a model to invent locally. `models.rs` uses explicit `#[serde(rename = "...")]` wire names exclusively; `rename_all` is rejected by the analyzer parser, because wire vocabulary (Postgres GUCs, SCIM URNs, region IDs, duration literals) cannot be derived from Rust identifiers by any casing rule, and explicit literals keep the code↔spec mapping verbatim and greppable. A new schema needs one Rust type per position it is used in: `{Name}` if the finding is in request position, `{Name}Response` if in response position, both if the spec uses it in both — and the same field added to every variant. See Request and response models above. + - Missing/extra operations: add or remove the corresponding `Client` method in the owning `src/client/.rs` file; only intentional non-OpenAPI helpers belong in `non_openapi_client_methods`. + - Missing models, fields, or extra fields: update public structs/enums/type aliases and Serde names in the owning `src/models/.rs` file, then re-export a new type from the `models.rs` facade. An undefined `$ref` (`missing_schema_definition`) is an upstream-spec defect, not a model to invent locally. The model tree uses explicit `#[serde(rename = "...")]` wire names exclusively; `rename_all` is rejected by the analyzer parser, because wire vocabulary (Postgres GUCs, SCIM URNs, region IDs, duration literals) cannot be derived from Rust identifiers by any casing rule, and explicit literals keep the code↔spec mapping verbatim and greppable. A new schema needs one Rust type per position it is used in: `{Name}` if the finding is in request position, `{Name}Response` if in response position, both if the spec uses it in both — and the same field added to every variant. See Request and response models above. - Optionality: express requiredness in the type, and pick the shape from the position. Request-position fields are `T` when the resolved spec requires them and `Option` plus `skip_serializing_if` otherwise; every response-position field is `Option` plus `skip_serializing_if`, whatever the spec says its requiredness is. Never add `#[serde(default)]`. A request field deliberately optional against the resolved spec needs an `optionality_exemptions` entry keyed on the **request** variant's name. - Missing/extra enum values: update the typed enum, its Serde wire value, and its `Display` implementation. Preserve data-carrying catch-all variants. - - Beta/deprecation findings: regenerate `BETA_OPERATIONS` with `python3 scripts/regenerate-beta-lists.py` and `DEPRECATED_FIELDS` with `python3 scripts/regenerate-deprecated-fields.py`; deprecated fields also need the matching `#[cfg(feature = "deprecated-fields")]` marker in `models.rs`. The generator works from the spec, which knows nothing about split variants, so a deprecated field on a split schema needs the `{Name}Response` entry and its marker added by hand. + - Beta/deprecation findings: regenerate `BETA_OPERATIONS` with `python3 scripts/regenerate-beta-lists.py` and `DEPRECATED_FIELDS` with `python3 scripts/regenerate-deprecated-fields.py`; deprecated fields also need the matching `#[cfg(feature = "deprecated-fields")]` marker in their model domain file. The generator works from the spec, which knows nothing about split variants, so a deprecated field on a split schema needs the `{Name}Response` entry and its marker added by hand. - Stale exemption: remove or narrow the configuration entry. Do not change comparison logic to preserve a stale exception. - Unsupported enum constraint: prefer changing the Rust scalar to a concrete value enum. Acknowledgement is the fallback policy below, not a model-drift fix. 4. Add focused library tests for changed models/methods. A new response type wants a missing-key → `None` and an explicit-`null` → `None` case; a new split pair wants the request variant's strictness and the `TryFrom` write-back asserted. If the unsupported inventory changes, update `acknowledged_unsupported_enum_pointers`; the snapshot test derives its exact expected inventory from that configuration. @@ -157,7 +159,7 @@ Enums that the CLI validates against declare `pub const VALUES: &'static [&'stat ##### 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` with a documented optionality exemption. Entries are keyed per Rust type, so a deprecated field on a split schema needs one entry and one marker for `{Name}` and one for `{Name}Response`. Update CLI code that directly accesses or constructs an affected model so both feature configurations compile. +Every spec-deprecated request or response field belongs in `meta.rs::DEPRECATED_FIELDS` and carries `#[cfg(feature = "deprecated-fields")]` on the field in its model domain file. It is therefore absent from the public model by default. Request fields that must be gated out but resolve as required are `Option` with a documented optionality exemption. Entries are keyed per Rust type, so a deprecated field on a split schema needs one entry and one marker for `{Name}` and one for `{Name}Response`. Update CLI code that directly accesses or constructs an affected model so both feature configurations compile. ##### Extending the analyzer diff --git a/crates/clickhouse-cloud-api/README.md b/crates/clickhouse-cloud-api/README.md index 92f7927..c22b3e8 100644 --- a/crates/clickhouse-cloud-api/README.md +++ b/crates/clickhouse-cloud-api/README.md @@ -8,8 +8,9 @@ Typed Rust client for the [ClickHouse Cloud API](https://clickhouse.com/docs/en/ | Path | Purpose | |------|---------| -| `src/client.rs` | `Client` struct with an async method per API endpoint | -| `src/models.rs` | Request/response types matching the OpenAPI spec | +| `src/client.rs`, `src/client/*.rs` | `Client`, shared HTTP machinery, and per-domain endpoint methods | +| `src/models.rs`, `src/models/*.rs` | Public facade/macro and private per-domain request/response models | +| `src/convert.rs`, `src/convert/*.rs` | Conversion error and per-domain response-to-request conversions | | `src/error.rs` | Error types (`Http`, `Json`, `Api`) | | `clickhouse_cloud_openapi.json` | Checked-in copy of the spec (used by tests) | | `tests/spec_coverage_test.rs` | Thin snapshot/live-spec consumer of the shared drift analyzer | @@ -28,7 +29,7 @@ Additional rules: - **PATCH request schemas** (name contains `Patch` and ends with `Request`) are always all-optional. - **Nullable fields** (`type: ["string", "null"]` or `oneOf` with null) are always `Option`, even if required. -In `models.rs`, required non-nullable fields use bare types (`T`) and optional/nullable fields use `Option`. All fields keep `#[serde(default)]` so deserialization is tolerant of partial data. +In `src/models/.rs`, request fields follow those rules: required non-nullable fields use `T`, while optional or nullable fields use `Option`. Every response field uses `Option` plus `skip_serializing_if`, so missing keys and explicit `null` deserialize natively to `None` and absent fields are omitted when serialized. `#[serde(default)]` is banned because it can fabricate required request values and is redundant for `Option` response fields. ### Deprecated fields @@ -50,7 +51,7 @@ python3 scripts/regenerate-beta-lists.py python3 scripts/check-openapi-drift.py --dry-run ``` -Field optionality is maintained by hand — edit `models.rs` directly when the drift check flags a mismatch. +Field optionality is maintained by hand. Edit the owning model domain file when the drift check flags a mismatch, and add new domain types to the private module and facade re-exports in `models.rs`. ### Testing @@ -88,11 +89,12 @@ All require `CLICKHOUSE_CLOUD_API_KEY`, `CLICKHOUSE_CLOUD_API_SECRET`, `CLICKHOU Manual `Cloud Integration` dispatches accept `scope=all`, `service`, `postgres`, `organization`, or `clickpipes`. The focused scopes run only their corresponding suite; `clickpipes` runs Postgres CDC plus the fixture-gated smoke test, while `all` runs all four mandatory suites plus that optional smoke test. For full-stack validation, manually run `scope=all` against the top stack branch. `spec_coverage_test` sends the checked-in sources and snapshot through the -private `clickhouse-openapi-analyzer` crate. That same analyzer powers the -scheduled live-spec issue, so operation, model, field, optionality, beta, -deprecation, enum, snapshot, and stale-exemption findings share one -implementation. The single ignored test runs the same report against the live -spec. +private `clickhouse-openapi-analyzer` crate. The analyzer recursively traverses +the module trees rooted at `client.rs`, `models.rs`, and `meta.rs`, including +private per-domain files. That same analyzer powers the scheduled live-spec +issue, so operation, model, field, optionality, beta, deprecation, enum, +snapshot, and stale-exemption findings share one implementation. The single +ignored test runs the same report against the live spec. ### Optionality exemptions diff --git a/crates/clickhouse-cloud-api/src/models.rs b/crates/clickhouse-cloud-api/src/models.rs index 2920a16..ea8054c 100644 --- a/crates/clickhouse-cloud-api/src/models.rs +++ b/crates/clickhouse-cloud-api/src/models.rs @@ -9,8 +9,6 @@ //! `{Name}Response`. `#[serde(default)]` is banned. See the crate-level docs for //! the policy and the reasoning behind it. -use serde::{Deserialize, Serialize}; - /// Generates the `Deserialize` impl for an externally-discriminated /// `#[serde(untagged)]` enum. /// @@ -84,7 +82,7 @@ use serde::{Deserialize, Serialize}; /// Without a `none` arm, an absent or non-string discriminator falls to /// `Unknown` through the final catch-all. /// -/// New discriminated unions in this module should use this macro rather than +/// New discriminated unions in the model tree should use this macro rather than /// hand-writing the impl. Enums whose variants need multi-level or nested /// dispatch do not fit this single-key shape and must stay hand-written. macro_rules! discriminated_union { @@ -131,6 +129,7 @@ mod api_keys; mod backups; mod byoc; mod clickpipes; +mod clickstack; mod clickstack_enums; mod invitations; mod members; @@ -170,6 +169,7 @@ pub use byoc::{ ByocInfrastructurePostRequestRegionid, }; pub use clickpipes::*; +pub use clickstack::*; pub use clickstack_enums::*; pub use invitations::{ Invitation, InvitationPostRequest, InvitationPostRequestRole, InvitationRole, @@ -249,4200 +249,3 @@ pub use udfs::{ UdfVersionCreateRequestV1, UdfVersionCreateRequestV1Type, UdfVersionCreateRequestV2, UdfVersionCreateRequestV2Type, UdfVersionListResponse, }; - -/// `ClickStackAlertChannel` - one of multiple variants. -/// -/// Dispatched on the `type` field; see the `discriminated_union!` -/// invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackAlertChannel { - ClickStackAlertChannelEmail(ClickStackAlertChannelEmail), - ClickStackAlertChannelWebhook(ClickStackAlertChannelWebhook), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackAlertChannel, "type" { - "email" => ClickStackAlertChannelEmail, - "webhook" => ClickStackAlertChannelWebhook, - } -} - -impl std::fmt::Display for ClickStackAlertChannel { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackAlertChannelEmail(_) => write!(f, "ClickStackAlertChannelEmail"), - Self::ClickStackAlertChannelWebhook(_) => write!(f, "ClickStackAlertChannelWebhook"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackAlertChannel` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackAlertChannel`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `type` field, exactly as the request union is: dispatch -/// reads the raw JSON rather than trying each variant's shape, so all-`Option` -/// arms — which would match any object under `untagged` matching — cannot -/// misroute a payload. A `type` this crate does not know, or a payload that -/// does not fit the variant its `type` selects, lands in `Unknown` with the -/// raw JSON intact. -/// -/// Deliberately has no `Default`: every arm's default would serialize to `{}`, -/// which carries no `type` and so would not deserialize back to the same -/// variant. Build a [`ClickStackAlertChannel`] instead when writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackAlertChannelResponse { - ClickStackAlertChannelEmail(ClickStackAlertChannelEmailResponse), - ClickStackAlertChannelWebhook(ClickStackAlertChannelWebhookResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackAlertChannelResponse, "type" { - "email" => ClickStackAlertChannelEmail, - "webhook" => ClickStackAlertChannelWebhook, - } -} - -impl std::fmt::Display for ClickStackAlertChannelResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackAlertChannelEmail(_) => write!(f, "ClickStackAlertChannelEmail"), - Self::ClickStackAlertChannelWebhook(_) => write!(f, "ClickStackAlertChannelWebhook"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackBarChartConfig` - one of multiple variants. -/// -/// Dispatched on the `configType` field (absent or non-string dispatches to the -/// builder variant, unless the payload carries a raw-SQL-only key); see the -/// `discriminated_union!` invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackBarChartConfig { - ClickStackBarBuilderChartConfig(ClickStackBarBuilderChartConfig), - ClickStackBarRawSqlChartConfig(ClickStackBarRawSqlChartConfig), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackBarChartConfig, "configType" { - "sql" => ClickStackBarRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackBarBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackBarChartConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackBarBuilderChartConfig(_) => { - write!(f, "ClickStackBarBuilderChartConfig") - } - Self::ClickStackBarRawSqlChartConfig(_) => write!(f, "ClickStackBarRawSqlChartConfig"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackBarChartConfig` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackBarChartConfig`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `configType` field exactly as the request union is (absent -/// or non-string dispatches to the builder variant, unless the payload carries -/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each -/// variant's shape, so all-`Option` arms — which would match any object under -/// `untagged` matching — cannot misroute a payload, and the `unless` guard -/// keeps a raw-SQL payload with a dropped discriminator out of the total -/// builder arm. A payload that does not fit the variant its discriminator -/// selects lands in `Unknown` with the raw JSON intact. -/// -/// Deliberately has no `Default`: response values are produced by -/// deserialization, never constructed; build a [`ClickStackBarChartConfig`] instead when -/// writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackBarChartConfigResponse { - ClickStackBarRawSqlChartConfig(ClickStackBarRawSqlChartConfigResponse), - ClickStackBarBuilderChartConfig(ClickStackBarBuilderChartConfigResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackBarChartConfigResponse, "configType" { - "sql" => ClickStackBarRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackBarBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackBarChartConfigResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackBarRawSqlChartConfig(_) => write!(f, "ClickStackBarRawSqlChartConfig"), - Self::ClickStackBarBuilderChartConfig(_) => { - write!(f, "ClickStackBarBuilderChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackCategoricalBarChartConfig` - one of multiple variants. -/// -/// Dispatched on the `configType` field (absent or non-string dispatches to the -/// builder variant, unless the payload carries a raw-SQL-only key); see the -/// `discriminated_union!` invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackCategoricalBarChartConfig { - ClickStackCategoricalBarBuilderChartConfig(ClickStackCategoricalBarBuilderChartConfig), - ClickStackCategoricalBarRawSqlChartConfig(ClickStackCategoricalBarRawSqlChartConfig), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackCategoricalBarChartConfig, "configType" { - "sql" => ClickStackCategoricalBarRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackCategoricalBarBuilderChartConfig, - } -} - -impl Default for ClickStackCategoricalBarChartConfig { - fn default() -> Self { - Self::ClickStackCategoricalBarBuilderChartConfig( - ClickStackCategoricalBarBuilderChartConfig::default(), - ) - } -} - -impl std::fmt::Display for ClickStackCategoricalBarChartConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackCategoricalBarBuilderChartConfig(_) => { - write!(f, "ClickStackCategoricalBarBuilderChartConfig") - } - Self::ClickStackCategoricalBarRawSqlChartConfig(_) => { - write!(f, "ClickStackCategoricalBarRawSqlChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackCategoricalBarChartConfig` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackCategoricalBarChartConfig`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `configType` field exactly as the request union is (absent -/// or non-string dispatches to the builder variant, unless the payload carries -/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each -/// variant's shape, so all-`Option` arms — which would match any object under -/// `untagged` matching — cannot misroute a payload, and the `unless` guard -/// keeps a raw-SQL payload with a dropped discriminator out of the total -/// builder arm. A payload that does not fit the variant its discriminator -/// selects lands in `Unknown` with the raw JSON intact. -/// -/// Deliberately has no `Default`: response values are produced by -/// deserialization, never constructed; build a [`ClickStackCategoricalBarChartConfig`] instead when -/// writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackCategoricalBarChartConfigResponse { - ClickStackCategoricalBarRawSqlChartConfig(ClickStackCategoricalBarRawSqlChartConfigResponse), - ClickStackCategoricalBarBuilderChartConfig(ClickStackCategoricalBarBuilderChartConfigResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackCategoricalBarChartConfigResponse, "configType" { - "sql" => ClickStackCategoricalBarRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackCategoricalBarBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackCategoricalBarChartConfigResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackCategoricalBarRawSqlChartConfig(_) => { - write!(f, "ClickStackCategoricalBarRawSqlChartConfig") - } - Self::ClickStackCategoricalBarBuilderChartConfig(_) => { - write!(f, "ClickStackCategoricalBarBuilderChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackDashboardChartSeries` - one of multiple variants. -/// -/// Dispatched on the `type` field; see the `discriminated_union!` -/// invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackDashboardChartSeries { - ClickStackTimeChartSeries(ClickStackTimeChartSeries), - ClickStackTableChartSeries(ClickStackTableChartSeries), - ClickStackNumberChartSeries(ClickStackNumberChartSeries), - ClickStackSearchChartSeries(ClickStackSearchChartSeries), - ClickStackMarkdownChartSeries(ClickStackMarkdownChartSeries), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackDashboardChartSeries, "type" { - "time" => ClickStackTimeChartSeries, - "table" => ClickStackTableChartSeries, - "number" => ClickStackNumberChartSeries, - "search" => ClickStackSearchChartSeries, - "markdown" => ClickStackMarkdownChartSeries, - } -} - -impl std::fmt::Display for ClickStackDashboardChartSeries { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackTimeChartSeries(_) => write!(f, "ClickStackTimeChartSeries"), - Self::ClickStackTableChartSeries(_) => write!(f, "ClickStackTableChartSeries"), - Self::ClickStackNumberChartSeries(_) => write!(f, "ClickStackNumberChartSeries"), - Self::ClickStackSearchChartSeries(_) => write!(f, "ClickStackSearchChartSeries"), - Self::ClickStackMarkdownChartSeries(_) => write!(f, "ClickStackMarkdownChartSeries"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackLineChartConfig` - one of multiple variants. -/// -/// Dispatched on the `configType` field (absent or non-string dispatches to the -/// builder variant, unless the payload carries a raw-SQL-only key); see the -/// `discriminated_union!` invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackLineChartConfig { - ClickStackLineBuilderChartConfig(ClickStackLineBuilderChartConfig), - ClickStackLineRawSqlChartConfig(ClickStackLineRawSqlChartConfig), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackLineChartConfig, "configType" { - "sql" => ClickStackLineRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackLineBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackLineChartConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackLineBuilderChartConfig(_) => { - write!(f, "ClickStackLineBuilderChartConfig") - } - Self::ClickStackLineRawSqlChartConfig(_) => { - write!(f, "ClickStackLineRawSqlChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackLineChartConfig` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackLineChartConfig`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `configType` field exactly as the request union is (absent -/// or non-string dispatches to the builder variant, unless the payload carries -/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each -/// variant's shape, so all-`Option` arms — which would match any object under -/// `untagged` matching — cannot misroute a payload, and the `unless` guard -/// keeps a raw-SQL payload with a dropped discriminator out of the total -/// builder arm. A payload that does not fit the variant its discriminator -/// selects lands in `Unknown` with the raw JSON intact. -/// -/// Deliberately has no `Default`: response values are produced by -/// deserialization, never constructed; build a [`ClickStackLineChartConfig`] instead when -/// writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackLineChartConfigResponse { - ClickStackLineRawSqlChartConfig(ClickStackLineRawSqlChartConfigResponse), - ClickStackLineBuilderChartConfig(ClickStackLineBuilderChartConfigResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackLineChartConfigResponse, "configType" { - "sql" => ClickStackLineRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackLineBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackLineChartConfigResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackLineRawSqlChartConfig(_) => { - write!(f, "ClickStackLineRawSqlChartConfig") - } - Self::ClickStackLineBuilderChartConfig(_) => { - write!(f, "ClickStackLineBuilderChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackNumberChartConfig` - one of multiple variants. -/// -/// Dispatched on the `configType` field (absent or non-string dispatches to the -/// builder variant, unless the payload carries a raw-SQL-only key); see the -/// `discriminated_union!` invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackNumberChartConfig { - ClickStackNumberBuilderChartConfig(ClickStackNumberBuilderChartConfig), - ClickStackNumberRawSqlChartConfig(ClickStackNumberRawSqlChartConfig), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackNumberChartConfig, "configType" { - "sql" => ClickStackNumberRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackNumberBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackNumberChartConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackNumberBuilderChartConfig(_) => { - write!(f, "ClickStackNumberBuilderChartConfig") - } - Self::ClickStackNumberRawSqlChartConfig(_) => { - write!(f, "ClickStackNumberRawSqlChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackNumberChartConfig` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackNumberChartConfig`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `configType` field exactly as the request union is (absent -/// or non-string dispatches to the builder variant, unless the payload carries -/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each -/// variant's shape, so all-`Option` arms — which would match any object under -/// `untagged` matching — cannot misroute a payload, and the `unless` guard -/// keeps a raw-SQL payload with a dropped discriminator out of the total -/// builder arm. A payload that does not fit the variant its discriminator -/// selects lands in `Unknown` with the raw JSON intact. -/// -/// Deliberately has no `Default`: response values are produced by -/// deserialization, never constructed; build a [`ClickStackNumberChartConfig`] instead when -/// writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackNumberChartConfigResponse { - ClickStackNumberRawSqlChartConfig(ClickStackNumberRawSqlChartConfigResponse), - ClickStackNumberBuilderChartConfig(ClickStackNumberBuilderChartConfigResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackNumberChartConfigResponse, "configType" { - "sql" => ClickStackNumberRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackNumberBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackNumberChartConfigResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackNumberRawSqlChartConfig(_) => { - write!(f, "ClickStackNumberRawSqlChartConfig") - } - Self::ClickStackNumberBuilderChartConfig(_) => { - write!(f, "ClickStackNumberBuilderChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackNumberTileColorCondition` - one of multiple variants. -/// -/// Dispatched on the `operator` field; see the `discriminated_union!` -/// invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackNumberTileColorCondition { - ClickStackNumericColorCondition(ClickStackNumericColorCondition), - ClickStackBetweenColorCondition(ClickStackBetweenColorCondition), - ClickStackEqualityColorCondition(ClickStackEqualityColorCondition), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackNumberTileColorCondition, "operator" { - "gt" | "gte" | "lt" | "lte" => ClickStackNumericColorCondition, - "between" => ClickStackBetweenColorCondition, - "eq" | "neq" => ClickStackEqualityColorCondition, - } -} - -impl std::fmt::Display for ClickStackNumberTileColorCondition { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackNumericColorCondition(_) => { - write!(f, "ClickStackNumericColorCondition") - } - Self::ClickStackBetweenColorCondition(_) => { - write!(f, "ClickStackBetweenColorCondition") - } - Self::ClickStackEqualityColorCondition(_) => { - write!(f, "ClickStackEqualityColorCondition") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackNumberTileColorCondition` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackNumberTileColorCondition`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `operator` field, exactly as the request union is: dispatch -/// reads the raw JSON rather than trying each variant's shape, so all-`Option` -/// arms — which would match any object under `untagged` matching — cannot -/// misroute a payload. A `operator` this crate does not know, or a payload that -/// does not fit the variant its `operator` selects, lands in `Unknown` with the -/// raw JSON intact. -/// -/// Deliberately has no `Default`: every arm's default would serialize to `{}`, -/// which carries no `operator` and so would not deserialize back to the same -/// variant. Build a [`ClickStackNumberTileColorCondition`] instead when writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackNumberTileColorConditionResponse { - ClickStackNumericColorCondition(ClickStackNumericColorConditionResponse), - ClickStackBetweenColorCondition(ClickStackBetweenColorConditionResponse), - ClickStackEqualityColorCondition(ClickStackEqualityColorConditionResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackNumberTileColorConditionResponse, "operator" { - "gt" | "gte" | "lt" | "lte" => ClickStackNumericColorCondition, - "between" => ClickStackBetweenColorCondition, - "eq" | "neq" => ClickStackEqualityColorCondition, - } -} - -impl std::fmt::Display for ClickStackNumberTileColorConditionResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackNumericColorCondition(_) => { - write!(f, "ClickStackNumericColorCondition") - } - Self::ClickStackBetweenColorCondition(_) => { - write!(f, "ClickStackBetweenColorCondition") - } - Self::ClickStackEqualityColorCondition(_) => { - write!(f, "ClickStackEqualityColorCondition") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackOnClick` - one of multiple variants. -/// -/// Dispatched on the `type` field; see the `discriminated_union!` -/// invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackOnClick { - ClickStackOnClickSearch(ClickStackOnClickSearch), - ClickStackOnClickDashboard(ClickStackOnClickDashboard), - ClickStackOnClickExternal(ClickStackOnClickExternal), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackOnClick, "type" { - "search" => ClickStackOnClickSearch, - "dashboard" => ClickStackOnClickDashboard, - "external" => ClickStackOnClickExternal, - } -} - -impl Default for ClickStackOnClick { - fn default() -> Self { - Self::Unknown(serde_json::Value::Null) - } -} - -impl std::fmt::Display for ClickStackOnClick { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackOnClickSearch(_) => write!(f, "ClickStackOnClickSearch"), - Self::ClickStackOnClickDashboard(_) => write!(f, "ClickStackOnClickDashboard"), - Self::ClickStackOnClickExternal(_) => write!(f, "ClickStackOnClickExternal"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackOnClick` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackOnClick`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `type` field, exactly as the request union is: dispatch -/// reads the raw JSON rather than trying each variant's shape, so all-`Option` -/// arms — which would match any object under `untagged` matching — cannot -/// misroute a payload. A `type` this crate does not know, or a payload that -/// does not fit the variant its `type` selects, lands in `Unknown` with the -/// raw JSON intact. -/// -/// Deliberately has no `Default`: every arm's default would serialize to `{}`, -/// which carries no `type` and so would not deserialize back to the same -/// variant. Build a [`ClickStackOnClick`] instead when writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackOnClickResponse { - ClickStackOnClickSearch(ClickStackOnClickSearchResponse), - ClickStackOnClickDashboard(ClickStackOnClickDashboardResponse), - ClickStackOnClickExternal(ClickStackOnClickExternalResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackOnClickResponse, "type" { - "search" => ClickStackOnClickSearch, - "dashboard" => ClickStackOnClickDashboard, - "external" => ClickStackOnClickExternal, - } -} - -impl std::fmt::Display for ClickStackOnClickResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackOnClickSearch(_) => write!(f, "ClickStackOnClickSearch"), - Self::ClickStackOnClickDashboard(_) => write!(f, "ClickStackOnClickDashboard"), - Self::ClickStackOnClickExternal(_) => write!(f, "ClickStackOnClickExternal"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackOnClickTarget` - one of multiple variants. -/// -/// Dispatched on the `mode` field; see the `discriminated_union!` -/// invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackOnClickTarget { - ClickStackOnClickTargetIdVariant(ClickStackOnClickTargetIdVariant), - ClickStackOnClickTargetTemplateVariant(ClickStackOnClickTargetTemplateVariant), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackOnClickTarget, "mode" { - "id" => ClickStackOnClickTargetIdVariant, - "template" => ClickStackOnClickTargetTemplateVariant, - } -} - -impl Default for ClickStackOnClickTarget { - fn default() -> Self { - Self::Unknown(serde_json::Value::Null) - } -} - -impl std::fmt::Display for ClickStackOnClickTarget { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackOnClickTargetIdVariant(_) => { - write!(f, "ClickStackOnClickTargetIdVariant") - } - Self::ClickStackOnClickTargetTemplateVariant(_) => { - write!(f, "ClickStackOnClickTargetTemplateVariant") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackOnClickTarget` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackOnClickTarget`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `mode` field, exactly as the request union is: dispatch -/// reads the raw JSON rather than trying each variant's shape, so all-`Option` -/// arms — which would match any object under `untagged` matching — cannot -/// misroute a payload. A `mode` this crate does not know, or a payload that -/// does not fit the variant its `mode` selects, lands in `Unknown` with the -/// raw JSON intact. -/// -/// Deliberately has no `Default`: every arm's default would serialize to `{}`, -/// which carries no `mode` and so would not deserialize back to the same -/// variant. Build a [`ClickStackOnClickTarget`] instead when writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackOnClickTargetResponse { - ClickStackOnClickTargetIdVariant(ClickStackOnClickTargetIdVariantResponse), - ClickStackOnClickTargetTemplateVariant(ClickStackOnClickTargetTemplateVariantResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackOnClickTargetResponse, "mode" { - "id" => ClickStackOnClickTargetIdVariant, - "template" => ClickStackOnClickTargetTemplateVariant, - } -} - -impl std::fmt::Display for ClickStackOnClickTargetResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackOnClickTargetIdVariant(_) => { - write!(f, "ClickStackOnClickTargetIdVariant") - } - Self::ClickStackOnClickTargetTemplateVariant(_) => { - write!(f, "ClickStackOnClickTargetTemplateVariant") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackPieChartConfig` - one of multiple variants. -/// -/// Dispatched on the `configType` field (absent or non-string dispatches to the -/// builder variant, unless the payload carries a raw-SQL-only key); see the -/// `discriminated_union!` invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackPieChartConfig { - ClickStackPieBuilderChartConfig(ClickStackPieBuilderChartConfig), - ClickStackPieRawSqlChartConfig(ClickStackPieRawSqlChartConfig), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackPieChartConfig, "configType" { - "sql" => ClickStackPieRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackPieBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackPieChartConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackPieBuilderChartConfig(_) => { - write!(f, "ClickStackPieBuilderChartConfig") - } - Self::ClickStackPieRawSqlChartConfig(_) => write!(f, "ClickStackPieRawSqlChartConfig"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackPieChartConfig` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackPieChartConfig`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `configType` field exactly as the request union is (absent -/// or non-string dispatches to the builder variant, unless the payload carries -/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each -/// variant's shape, so all-`Option` arms — which would match any object under -/// `untagged` matching — cannot misroute a payload, and the `unless` guard -/// keeps a raw-SQL payload with a dropped discriminator out of the total -/// builder arm. A payload that does not fit the variant its discriminator -/// selects lands in `Unknown` with the raw JSON intact. -/// -/// Deliberately has no `Default`: response values are produced by -/// deserialization, never constructed; build a [`ClickStackPieChartConfig`] instead when -/// writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackPieChartConfigResponse { - ClickStackPieRawSqlChartConfig(ClickStackPieRawSqlChartConfigResponse), - ClickStackPieBuilderChartConfig(ClickStackPieBuilderChartConfigResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackPieChartConfigResponse, "configType" { - "sql" => ClickStackPieRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackPieBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackPieChartConfigResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackPieRawSqlChartConfig(_) => write!(f, "ClickStackPieRawSqlChartConfig"), - Self::ClickStackPieBuilderChartConfig(_) => { - write!(f, "ClickStackPieBuilderChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackSource` - one of multiple variants. -/// -/// Dispatched on the `kind` field; see the `discriminated_union!` -/// invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackSource { - ClickStackLogSource(ClickStackLogSource), - ClickStackTraceSource(ClickStackTraceSource), - ClickStackMetricSource(ClickStackMetricSource), - ClickStackSessionSource(ClickStackSessionSource), - ClickStackPromqlSource(ClickStackPromqlSource), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackSource, "kind" { - "log" => ClickStackLogSource, - "trace" => ClickStackTraceSource, - "metric" => ClickStackMetricSource, - "session" => ClickStackSessionSource, - "promql" => ClickStackPromqlSource, - } -} - -impl std::fmt::Display for ClickStackSource { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackLogSource(_) => write!(f, "ClickStackLogSource"), - Self::ClickStackTraceSource(_) => write!(f, "ClickStackTraceSource"), - Self::ClickStackMetricSource(_) => write!(f, "ClickStackMetricSource"), - Self::ClickStackSessionSource(_) => write!(f, "ClickStackSessionSource"), - Self::ClickStackPromqlSource(_) => write!(f, "ClickStackPromqlSource"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackSource` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackSource`]: each arm is the all-`Option` -/// response variant of its request struct, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `kind` field, exactly as the request union is: dispatch -/// reads the raw JSON rather than trying each variant's shape, so all-`Option` -/// arms — which would match any object under `untagged` matching — cannot -/// misroute a payload. A `kind` this crate does not know, or a payload that does -/// not fit the variant its `kind` selects, lands in `Unknown` with the raw JSON -/// intact. -/// -/// Deliberately has no `Default`: every arm's default would serialize to `{}`, -/// which carries no `kind` and so would not deserialize back to the same -/// variant. Build a [`ClickStackSource`] instead when writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackSourceResponse { - ClickStackLogSource(ClickStackLogSourceResponse), - ClickStackTraceSource(ClickStackTraceSourceResponse), - ClickStackMetricSource(ClickStackMetricSourceResponse), - ClickStackSessionSource(ClickStackSessionSourceResponse), - ClickStackPromqlSource(ClickStackPromqlSourceResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackSourceResponse, "kind" { - "log" => ClickStackLogSource, - "trace" => ClickStackTraceSource, - "metric" => ClickStackMetricSource, - "session" => ClickStackSessionSource, - "promql" => ClickStackPromqlSource, - } -} - -impl std::fmt::Display for ClickStackSourceResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackLogSource(_) => write!(f, "ClickStackLogSource"), - Self::ClickStackTraceSource(_) => write!(f, "ClickStackTraceSource"), - Self::ClickStackMetricSource(_) => write!(f, "ClickStackMetricSource"), - Self::ClickStackSessionSource(_) => write!(f, "ClickStackSessionSource"), - Self::ClickStackPromqlSource(_) => write!(f, "ClickStackPromqlSource"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackTableChartConfig` - one of multiple variants. -/// -/// Dispatched on the `configType` field (absent or non-string dispatches to the -/// builder variant, unless the payload carries a raw-SQL-only key); see the -/// `discriminated_union!` invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackTableChartConfig { - ClickStackTableBuilderChartConfig(ClickStackTableBuilderChartConfig), - ClickStackTableRawSqlChartConfig(ClickStackTableRawSqlChartConfig), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackTableChartConfig, "configType" { - "sql" => ClickStackTableRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackTableBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackTableChartConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackTableBuilderChartConfig(_) => { - write!(f, "ClickStackTableBuilderChartConfig") - } - Self::ClickStackTableRawSqlChartConfig(_) => { - write!(f, "ClickStackTableRawSqlChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackTableChartConfig` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackTableChartConfig`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `configType` field exactly as the request union is (absent -/// or non-string dispatches to the builder variant, unless the payload carries -/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each -/// variant's shape, so all-`Option` arms — which would match any object under -/// `untagged` matching — cannot misroute a payload, and the `unless` guard -/// keeps a raw-SQL payload with a dropped discriminator out of the total -/// builder arm. A payload that does not fit the variant its discriminator -/// selects lands in `Unknown` with the raw JSON intact. -/// -/// Deliberately has no `Default`: response values are produced by -/// deserialization, never constructed; build a [`ClickStackTableChartConfig`] instead when -/// writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackTableChartConfigResponse { - ClickStackTableRawSqlChartConfig(ClickStackTableRawSqlChartConfigResponse), - ClickStackTableBuilderChartConfig(ClickStackTableBuilderChartConfigResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackTableChartConfigResponse, "configType" { - "sql" => ClickStackTableRawSqlChartConfig, - none unless "connectionId" | "sqlTemplate" => ClickStackTableBuilderChartConfig, - } -} - -impl std::fmt::Display for ClickStackTableChartConfigResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackTableRawSqlChartConfig(_) => { - write!(f, "ClickStackTableRawSqlChartConfig") - } - Self::ClickStackTableBuilderChartConfig(_) => { - write!(f, "ClickStackTableBuilderChartConfig") - } - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackTileConfig` - one of multiple variants. -/// -/// Dispatched on the `displayType` field; see the `discriminated_union!` -/// invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackTileConfig { - ClickStackCategoricalBarChartConfig(ClickStackCategoricalBarChartConfig), - ClickStackLineChartConfig(ClickStackLineChartConfig), - ClickStackBarChartConfig(ClickStackBarChartConfig), - ClickStackTableChartConfig(ClickStackTableChartConfig), - ClickStackNumberChartConfig(ClickStackNumberChartConfig), - ClickStackPieChartConfig(ClickStackPieChartConfig), - ClickStackHeatmapChartConfig(ClickStackHeatmapChartConfig), - ClickStackSearchChartConfig(ClickStackSearchChartConfig), - ClickStackEventPatternsChartConfig(ClickStackEventPatternsChartConfig), - ClickStackMarkdownChartConfig(ClickStackMarkdownChartConfig), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackTileConfig, "displayType" { - "line" => ClickStackLineChartConfig, - "stacked_bar" => ClickStackBarChartConfig, - "bar" => ClickStackCategoricalBarChartConfig, - "table" => ClickStackTableChartConfig, - "number" => ClickStackNumberChartConfig, - "pie" => ClickStackPieChartConfig, - "heatmap" => ClickStackHeatmapChartConfig, - "search" => ClickStackSearchChartConfig, - "event_patterns" => ClickStackEventPatternsChartConfig, - "markdown" => ClickStackMarkdownChartConfig, - } -} - -impl std::fmt::Display for ClickStackTileConfig { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackCategoricalBarChartConfig(_) => { - write!(f, "ClickStackCategoricalBarChartConfig") - } - Self::ClickStackLineChartConfig(_) => write!(f, "ClickStackLineChartConfig"), - Self::ClickStackBarChartConfig(_) => write!(f, "ClickStackBarChartConfig"), - Self::ClickStackTableChartConfig(_) => write!(f, "ClickStackTableChartConfig"), - Self::ClickStackNumberChartConfig(_) => write!(f, "ClickStackNumberChartConfig"), - Self::ClickStackPieChartConfig(_) => write!(f, "ClickStackPieChartConfig"), - Self::ClickStackHeatmapChartConfig(_) => write!(f, "ClickStackHeatmapChartConfig"), - Self::ClickStackSearchChartConfig(_) => write!(f, "ClickStackSearchChartConfig"), - Self::ClickStackEventPatternsChartConfig(_) => { - write!(f, "ClickStackEventPatternsChartConfig") - } - Self::ClickStackMarkdownChartConfig(_) => write!(f, "ClickStackMarkdownChartConfig"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackTileConfig` - one of multiple variants, in response position. -/// -/// Response variant of [`ClickStackTileConfig`]: each arm is the all-`Option` -/// response variant of its request type, so a field the API drops or sends as -/// `null` deserializes to `None` instead of failing. -/// -/// Dispatched on the `displayType` field, exactly as the request union is: dispatch -/// reads the raw JSON rather than trying each variant's shape, so all-`Option` -/// arms — which would match any object under `untagged` matching — cannot -/// misroute a payload. A `displayType` this crate does not know, or a payload that -/// does not fit the variant its `displayType` selects, lands in `Unknown` with the -/// raw JSON intact. -/// -/// Deliberately has no `Default`: every arm's default would serialize to `{}`, -/// which carries no `displayType` and so would not deserialize back to the same -/// variant. Build a [`ClickStackTileConfig`] instead when writing. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackTileConfigResponse { - ClickStackLineChartConfig(ClickStackLineChartConfigResponse), - ClickStackBarChartConfig(ClickStackBarChartConfigResponse), - ClickStackCategoricalBarChartConfig(ClickStackCategoricalBarChartConfigResponse), - ClickStackTableChartConfig(ClickStackTableChartConfigResponse), - ClickStackNumberChartConfig(ClickStackNumberChartConfigResponse), - ClickStackPieChartConfig(ClickStackPieChartConfigResponse), - ClickStackHeatmapChartConfig(ClickStackHeatmapChartConfigResponse), - ClickStackSearchChartConfig(ClickStackSearchChartConfigResponse), - ClickStackEventPatternsChartConfig(ClickStackEventPatternsChartConfigResponse), - ClickStackMarkdownChartConfig(ClickStackMarkdownChartConfigResponse), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackTileConfigResponse, "displayType" { - "line" => ClickStackLineChartConfig, - "stacked_bar" => ClickStackBarChartConfig, - "bar" => ClickStackCategoricalBarChartConfig, - "table" => ClickStackTableChartConfig, - "number" => ClickStackNumberChartConfig, - "pie" => ClickStackPieChartConfig, - "heatmap" => ClickStackHeatmapChartConfig, - "search" => ClickStackSearchChartConfig, - "event_patterns" => ClickStackEventPatternsChartConfig, - "markdown" => ClickStackMarkdownChartConfig, - } -} - -impl std::fmt::Display for ClickStackTileConfigResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackLineChartConfig(_) => write!(f, "ClickStackLineChartConfig"), - Self::ClickStackBarChartConfig(_) => write!(f, "ClickStackBarChartConfig"), - Self::ClickStackCategoricalBarChartConfig(_) => { - write!(f, "ClickStackCategoricalBarChartConfig") - } - Self::ClickStackTableChartConfig(_) => write!(f, "ClickStackTableChartConfig"), - Self::ClickStackNumberChartConfig(_) => write!(f, "ClickStackNumberChartConfig"), - Self::ClickStackPieChartConfig(_) => write!(f, "ClickStackPieChartConfig"), - Self::ClickStackHeatmapChartConfig(_) => write!(f, "ClickStackHeatmapChartConfig"), - Self::ClickStackSearchChartConfig(_) => write!(f, "ClickStackSearchChartConfig"), - Self::ClickStackEventPatternsChartConfig(_) => { - write!(f, "ClickStackEventPatternsChartConfig") - } - Self::ClickStackMarkdownChartConfig(_) => write!(f, "ClickStackMarkdownChartConfig"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// `ClickStackWebhook` - one of multiple variants. -/// -/// Dispatched on the `service` field; see the `discriminated_union!` -/// invocation below for the wire values. -#[derive(Debug, Clone, PartialEq, Serialize)] -#[serde(untagged)] -pub enum ClickStackWebhook { - ClickStackSlackWebhook(ClickStackSlackWebhook), - ClickStackIncidentIOWebhook(ClickStackIncidentIOWebhook), - ClickStackGenericWebhook(ClickStackGenericWebhook), - ClickStackSlackAPIWebhook(ClickStackSlackAPIWebhook), - ClickStackPagerDutyAPIWebhook(ClickStackPagerDutyAPIWebhook), - /// Catch-all for unknown or newly-added values. - /// - /// Holds the raw payload as `serde_json::Value` so it round-trips - /// losslessly; its `Display` emits the payload as compact JSON. - Unknown(serde_json::Value), -} - -discriminated_union! { - ClickStackWebhook, "service" { - "slack" => ClickStackSlackWebhook, - "incidentio" => ClickStackIncidentIOWebhook, - "generic" => ClickStackGenericWebhook, - "slack_api" => ClickStackSlackAPIWebhook, - "pagerduty_api" => ClickStackPagerDutyAPIWebhook, - } -} - -impl std::fmt::Display for ClickStackWebhook { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::ClickStackSlackWebhook(_) => write!(f, "ClickStackSlackWebhook"), - Self::ClickStackIncidentIOWebhook(_) => write!(f, "ClickStackIncidentIOWebhook"), - Self::ClickStackGenericWebhook(_) => write!(f, "ClickStackGenericWebhook"), - Self::ClickStackSlackAPIWebhook(_) => write!(f, "ClickStackSlackAPIWebhook"), - Self::ClickStackPagerDutyAPIWebhook(_) => write!(f, "ClickStackPagerDutyAPIWebhook"), - Self::Unknown(s) => write!(f, "{s}"), - } - } -} - -/// Type alias for `ClickStackCASLPermissionConditions`. -pub type ClickStackCASLPermissionConditions = serde_json::Value; - -/// Type alias for `ClickStackValidateDashboardResponseNormalized`. -pub type ClickStackValidateDashboardResponseNormalized = serde_json::Value; - -/// Type alias for `ClickStackWebhookInputHeaders`. -pub type ClickStackWebhookInputHeaders = std::collections::BTreeMap; - -/// Type alias for `ClickStackWebhookInputQueryParams`. -pub type ClickStackWebhookInputQueryParams = std::collections::BTreeMap; - -/// `ClickStackAggregatedColumn` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAggregatedColumn { - #[serde(rename = "aggFn")] - pub agg_fn: String, - #[serde(rename = "mvColumn")] - pub mv_column: String, - #[serde(rename = "sourceColumn", skip_serializing_if = "Option::is_none")] - pub source_column: Option, -} - -/// `ClickStackAggregatedColumn` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackAggregatedColumn`]: every field is -/// `Option`, so a field the API drops or sends as `null` deserializes to -/// `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAggregatedColumnResponse { - #[serde(rename = "aggFn", skip_serializing_if = "Option::is_none")] - pub agg_fn: Option, - #[serde(rename = "mvColumn", skip_serializing_if = "Option::is_none")] - pub mv_column: Option, - #[serde(rename = "sourceColumn", skip_serializing_if = "Option::is_none")] - pub source_column: Option, -} - -/// `ClickStackAlertChannelEmail` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAlertChannelEmail { - #[serde(rename = "emailRecipients")] - pub email_recipients: Vec, - pub r#type: ClickStackAlertChannelEmailType, -} - -/// `ClickStackAlertChannelEmail` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackAlertChannelEmail`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAlertChannelEmailResponse { - #[serde(rename = "emailRecipients", skip_serializing_if = "Option::is_none")] - pub email_recipients: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -/// `ClickStackAlertChannelWebhook` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAlertChannelWebhook { - #[serde(skip_serializing_if = "Option::is_none")] - pub severity: Option, - #[serde(rename = "slackChannelId", skip_serializing_if = "Option::is_none")] - pub slack_channel_id: Option, - pub r#type: ClickStackAlertChannelWebhookType, - #[serde(rename = "webhookId")] - pub webhook_id: String, - #[serde(rename = "webhookService", skip_serializing_if = "Option::is_none")] - pub webhook_service: Option, -} - -/// `ClickStackAlertChannelWebhook` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackAlertChannelWebhook`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAlertChannelWebhookResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub severity: Option, - #[serde(rename = "slackChannelId", skip_serializing_if = "Option::is_none")] - pub slack_channel_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, - #[serde(rename = "webhookId", skip_serializing_if = "Option::is_none")] - pub webhook_id: Option, - #[serde(rename = "webhookService", skip_serializing_if = "Option::is_none")] - pub webhook_service: Option, -} - -/// `ClickStackAlertExecutionError` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAlertExecutionError { - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub timestamp: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -/// `ClickStackAlertResponse` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAlertResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub channel: Option, - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(rename = "dashboardId", skip_serializing_if = "Option::is_none")] - pub dashboard_id: Option, - #[serde(rename = "executionErrors", skip_serializing_if = "Option::is_none")] - pub execution_errors: Option>, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub note: Option, - #[serde( - rename = "numConsecutiveWindows", - skip_serializing_if = "Option::is_none" - )] - pub num_consecutive_windows: Option, - #[serde(rename = "savedSearchId", skip_serializing_if = "Option::is_none")] - pub saved_search_id: Option, - #[serde( - rename = "scheduleOffsetMinutes", - skip_serializing_if = "Option::is_none" - )] - pub schedule_offset_minutes: Option, - #[serde(rename = "scheduleStartAt", skip_serializing_if = "Option::is_none")] - pub schedule_start_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub silenced: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, - #[serde(rename = "teamId", skip_serializing_if = "Option::is_none")] - pub team_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub threshold: Option, - #[serde(rename = "thresholdMax", skip_serializing_if = "Option::is_none")] - pub threshold_max: Option, - #[serde(rename = "thresholdType", skip_serializing_if = "Option::is_none")] - pub threshold_type: Option, - #[serde(rename = "tileId", skip_serializing_if = "Option::is_none")] - pub tile_id: Option, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, -} - -/// `ClickStackAlertSilenced` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackAlertSilenced { - #[serde(skip_serializing_if = "Option::is_none")] - pub at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub until: Option>, -} - -/// `ClickStackBackgroundChart` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackBackgroundChart { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - pub r#type: ClickStackBackgroundChartType, -} - -/// `ClickStackBackgroundChart` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackBackgroundChart`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackBackgroundChartResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -/// `ClickStackBarBuilderChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackBarBuilderChartConfig { - #[serde( - rename = "alignDateRangeToGranularity", - skip_serializing_if = "Option::is_none" - )] - pub align_date_range_to_granularity: Option, - #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] - pub as_ratio: Option, - #[serde(rename = "displayType")] - pub display_type: ClickStackBarBuilderChartConfigDisplaytype, - #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] - pub fill_nulls: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - pub select: Vec, - #[serde(rename = "sourceId")] - pub source_id: String, -} - -/// `ClickStackBarBuilderChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackBarBuilderChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackBarBuilderChartConfigResponse { - #[serde( - rename = "alignDateRangeToGranularity", - skip_serializing_if = "Option::is_none" - )] - pub align_date_range_to_granularity: Option, - #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] - pub as_ratio: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] - pub fill_nulls: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option>, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, -} - -/// `ClickStackBarRawSqlChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackBarRawSqlChartConfig { - #[serde( - rename = "alignDateRangeToGranularity", - skip_serializing_if = "Option::is_none" - )] - pub align_date_range_to_granularity: Option, - #[serde(rename = "configType")] - pub config_type: ClickStackBarRawSqlChartConfigConfigtype, - #[serde(rename = "connectionId")] - pub connection_id: String, - #[serde(rename = "displayType")] - pub display_type: ClickStackBarRawSqlChartConfigDisplaytype, - #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] - pub fill_nulls: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate")] - pub sql_template: String, -} - -/// `ClickStackBarRawSqlChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackBarRawSqlChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackBarRawSqlChartConfigResponse { - #[serde( - rename = "alignDateRangeToGranularity", - skip_serializing_if = "Option::is_none" - )] - pub align_date_range_to_granularity: Option, - #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] - pub config_type: Option, - #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] - pub connection_id: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] - pub fill_nulls: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] - pub sql_template: Option, -} - -/// `ClickStackBetweenColorCondition` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackBetweenColorCondition { - pub color: ClickStackChartColor, - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - pub operator: ClickStackBetweenColorConditionOperator, - pub value: Vec, -} - -/// `ClickStackBetweenColorCondition` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackBetweenColorCondition`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackBetweenColorConditionResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub operator: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option>, -} - -/// `ClickStackCASLPermission` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCASLPermission { - pub action: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub conditions: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub integration: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub inverted: Option, - pub subject: String, -} - -/// `ClickStackCASLPermission` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackCASLPermission`]: every field is -/// `Option`, so a field the API drops or sends as `null` deserializes to -/// `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCASLPermissionResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub action: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub conditions: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub integration: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub inverted: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subject: Option, -} - -/// `ClickStackCategoricalBarBuilderChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCategoricalBarBuilderChartConfig { - #[serde(rename = "displayType")] - pub display_type: ClickStackCategoricalBarBuilderChartConfigDisplaytype, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] - pub order_by: Option, - pub select: Vec, - #[serde(rename = "sourceId")] - pub source_id: String, -} - -/// `ClickStackCategoricalBarBuilderChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackCategoricalBarBuilderChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCategoricalBarBuilderChartConfigResponse { - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] - pub order_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option>, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, -} - -/// `ClickStackCategoricalBarRawSqlChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCategoricalBarRawSqlChartConfig { - #[serde(rename = "configType")] - pub config_type: ClickStackCategoricalBarRawSqlChartConfigConfigtype, - #[serde(rename = "connectionId")] - pub connection_id: String, - #[serde(rename = "displayType")] - pub display_type: ClickStackCategoricalBarRawSqlChartConfigDisplaytype, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate")] - pub sql_template: String, -} - -/// `ClickStackCategoricalBarRawSqlChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackCategoricalBarRawSqlChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCategoricalBarRawSqlChartConfigResponse { - #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] - pub config_type: Option, - #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] - pub connection_id: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] - pub sql_template: Option, -} - -/// `ClickStackConnection` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackConnection { - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub host: Option, - #[serde( - rename = "hyperdxSettingPrefix", - skip_serializing_if = "Option::is_none" - )] - pub hyperdx_setting_prefix: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde( - rename = "isPrometheusEndpoint", - skip_serializing_if = "Option::is_none" - )] - pub is_prometheus_endpoint: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub username: Option, -} - -/// `ClickStackCreateAlertRequest` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCreateAlertRequest { - pub channel: ClickStackAlertChannel, - #[serde(rename = "dashboardId", skip_serializing_if = "Option::is_none")] - pub dashboard_id: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - pub interval: ClickStackCreateAlertRequestInterval, - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub note: Option, - #[serde( - rename = "numConsecutiveWindows", - skip_serializing_if = "Option::is_none" - )] - pub num_consecutive_windows: Option, - #[serde(rename = "savedSearchId", skip_serializing_if = "Option::is_none")] - pub saved_search_id: Option, - #[serde( - rename = "scheduleOffsetMinutes", - skip_serializing_if = "Option::is_none" - )] - pub schedule_offset_minutes: Option, - #[serde(rename = "scheduleStartAt", skip_serializing_if = "Option::is_none")] - pub schedule_start_at: Option>, - pub source: ClickStackCreateAlertRequestSource, - pub threshold: f64, - #[serde(rename = "thresholdMax", skip_serializing_if = "Option::is_none")] - pub threshold_max: Option, - #[serde(rename = "thresholdType")] - pub threshold_type: ClickStackCreateAlertRequestThresholdtype, - #[serde(rename = "tileId", skip_serializing_if = "Option::is_none")] - pub tile_id: Option, -} - -/// `ClickStackCreateConnectionRequest` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCreateConnectionRequest { - pub host: String, - #[serde( - rename = "hyperdxSettingPrefix", - skip_serializing_if = "Option::is_none" - )] - pub hyperdx_setting_prefix: Option, - #[serde( - rename = "isPrometheusEndpoint", - skip_serializing_if = "Option::is_none" - )] - pub is_prometheus_endpoint: Option, - pub name: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub password: Option, - pub username: String, -} - -/// `ClickStackCreateDashboardRequest` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCreateDashboardRequest { - #[serde(skip_serializing_if = "Option::is_none")] - pub containers: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - pub name: String, - #[serde(rename = "savedFilterValues", skip_serializing_if = "Option::is_none")] - pub saved_filter_values: Option>, - #[serde(rename = "savedQuery", skip_serializing_if = "Option::is_none")] - pub saved_query: Option, - #[serde(rename = "savedQueryLanguage", skip_serializing_if = "Option::is_none")] - pub saved_query_language: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub tags: Option>, - pub tiles: Vec, -} - -/// `ClickStackCreateRoleRequest` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackCreateRoleRequest { - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - pub name: String, - pub permissions: Vec, -} - -/// `ClickStackDashboardContainer` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackDashboardContainer { - #[serde(skip_serializing_if = "Option::is_none")] - pub bordered: Option, - pub collapsed: bool, - #[serde(skip_serializing_if = "Option::is_none")] - pub collapsible: Option, - pub id: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub tabs: Option>, - pub title: String, -} - -/// `ClickStackDashboardContainer` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackDashboardContainer`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackDashboardContainerResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub bordered: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub collapsed: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub collapsible: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub tabs: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub title: Option, -} - -/// `ClickStackDashboardContainerTab` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackDashboardContainerTab { - pub id: String, - pub title: String, -} - -/// `ClickStackDashboardContainerTab` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackDashboardContainerTab`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackDashboardContainerTabResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub title: Option, -} - -/// `ClickStackDashboardResponse` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackDashboardResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub containers: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "savedFilterValues", skip_serializing_if = "Option::is_none")] - pub saved_filter_values: Option>, - #[serde(rename = "savedQuery", skip_serializing_if = "Option::is_none")] - pub saved_query: Option, - #[serde(rename = "savedQueryLanguage", skip_serializing_if = "Option::is_none")] - pub saved_query_language: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub tags: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub tiles: Option>, -} - -/// `ClickStackEqualityColorCondition` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackEqualityColorCondition { - pub color: ClickStackChartColor, - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - pub operator: ClickStackEqualityColorConditionOperator, - /// A finite number or a string; the spec models this as `oneOf number|string`. - pub value: serde_json::Value, -} - -/// `ClickStackEqualityColorCondition` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackEqualityColorCondition`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackEqualityColorConditionResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub operator: Option, - /// A finite number or a string; the spec models this as `oneOf number|string`. - #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option, -} - -/// `ClickStackEventPatternsChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackEventPatternsChartConfig { - #[serde(rename = "displayType")] - pub display_type: ClickStackEventPatternsChartConfigDisplaytype, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option, - #[serde(rename = "sourceId")] - pub source_id: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackEventPatternsChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackEventPatternsChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackEventPatternsChartConfigResponse { - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackFilter` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackFilter { - #[serde(rename = "appliesToSourceIds", skip_serializing_if = "Option::is_none")] - pub applies_to_source_ids: Option>, - pub expression: String, - pub id: String, - pub name: String, - #[serde(rename = "sourceId")] - pub source_id: String, - #[serde(rename = "sourceMetricType", skip_serializing_if = "Option::is_none")] - pub source_metric_type: Option, - pub r#type: ClickStackFilterType, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackFilter` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackFilter`]: every field is `Option`, so a -/// field the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackFilterResponse { - #[serde(rename = "appliesToSourceIds", skip_serializing_if = "Option::is_none")] - pub applies_to_source_ids: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sourceMetricType", skip_serializing_if = "Option::is_none")] - pub source_metric_type: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackFilterInput` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackFilterInput { - #[serde(rename = "appliesToSourceIds", skip_serializing_if = "Option::is_none")] - pub applies_to_source_ids: Option>, - pub expression: String, - pub name: String, - #[serde(rename = "sourceId")] - pub source_id: String, - #[serde(rename = "sourceMetricType", skip_serializing_if = "Option::is_none")] - pub source_metric_type: Option, - pub r#type: ClickStackFilterInputType, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackFilterSettingsColumn` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackFilterSettingsColumn { - pub label: String, - pub name: String, -} - -/// `ClickStackFilterSettingsColumn` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackFilterSettingsColumn`]: every field is -/// `Option`, so a field the API drops or sends as `null` deserializes to -/// `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackFilterSettingsColumnResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -/// `ClickStackGenericWebhook` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackGenericWebhook { - #[serde(skip_serializing_if = "Option::is_none")] - pub body: Option, - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub service: Option, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -/// `ClickStackHeatmapChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackHeatmapChartConfig { - #[serde(rename = "displayType")] - pub display_type: ClickStackHeatmapChartConfigDisplaytype, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - pub select: Vec, - #[serde(rename = "sourceId")] - pub source_id: String, - #[serde(rename = "where", skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackHeatmapChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackHeatmapChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackHeatmapChartConfigResponse { - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option>, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "where", skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackHeatmapSelectItem` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackHeatmapSelectItem { - #[serde(rename = "countExpression", skip_serializing_if = "Option::is_none")] - pub count_expression: Option, - #[serde(rename = "heatmapScaleType", skip_serializing_if = "Option::is_none")] - pub heatmap_scale_type: Option, - #[serde(rename = "valueExpression")] - pub value_expression: String, -} - -/// `ClickStackHeatmapSelectItem` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackHeatmapSelectItem`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackHeatmapSelectItemResponse { - #[serde(rename = "countExpression", skip_serializing_if = "Option::is_none")] - pub count_expression: Option, - #[serde(rename = "heatmapScaleType", skip_serializing_if = "Option::is_none")] - pub heatmap_scale_type: Option, - #[serde(rename = "valueExpression", skip_serializing_if = "Option::is_none")] - pub value_expression: Option, -} - -/// `ClickStackHighlightedAttributeExpression` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackHighlightedAttributeExpression { - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - #[serde(rename = "luceneExpression", skip_serializing_if = "Option::is_none")] - pub lucene_expression: Option, - #[serde(rename = "sqlExpression")] - pub sql_expression: String, -} - -/// `ClickStackHighlightedAttributeExpression` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackHighlightedAttributeExpression`]: every -/// field is `Option`, so a field the API drops or sends as `null` -/// deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackHighlightedAttributeExpressionResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - #[serde(rename = "luceneExpression", skip_serializing_if = "Option::is_none")] - pub lucene_expression: Option, - #[serde(rename = "sqlExpression", skip_serializing_if = "Option::is_none")] - pub sql_expression: Option, -} - -/// `ClickStackIncidentIOWebhook` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackIncidentIOWebhook { - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub service: Option, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -/// `ClickStackLineBuilderChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackLineBuilderChartConfig { - #[serde( - rename = "alignDateRangeToGranularity", - skip_serializing_if = "Option::is_none" - )] - pub align_date_range_to_granularity: Option, - #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] - pub as_ratio: Option, - #[serde( - rename = "compareToPreviousPeriod", - skip_serializing_if = "Option::is_none" - )] - pub compare_to_previous_period: Option, - #[serde(rename = "displayType")] - pub display_type: ClickStackLineBuilderChartConfigDisplaytype, - #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] - pub fill_nulls: Option, - #[serde(rename = "fitYAxisToData", skip_serializing_if = "Option::is_none")] - pub fit_y_axis_to_data: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - pub select: Vec, - #[serde(rename = "sourceId")] - pub source_id: String, -} - -/// `ClickStackLineBuilderChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackLineBuilderChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackLineBuilderChartConfigResponse { - #[serde( - rename = "alignDateRangeToGranularity", - skip_serializing_if = "Option::is_none" - )] - pub align_date_range_to_granularity: Option, - #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] - pub as_ratio: Option, - #[serde( - rename = "compareToPreviousPeriod", - skip_serializing_if = "Option::is_none" - )] - pub compare_to_previous_period: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] - pub fill_nulls: Option, - #[serde(rename = "fitYAxisToData", skip_serializing_if = "Option::is_none")] - pub fit_y_axis_to_data: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option>, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, -} - -/// `ClickStackLineRawSqlChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackLineRawSqlChartConfig { - #[serde( - rename = "alignDateRangeToGranularity", - skip_serializing_if = "Option::is_none" - )] - pub align_date_range_to_granularity: Option, - #[serde( - rename = "compareToPreviousPeriod", - skip_serializing_if = "Option::is_none" - )] - pub compare_to_previous_period: Option, - #[serde(rename = "configType")] - pub config_type: ClickStackLineRawSqlChartConfigConfigtype, - #[serde(rename = "connectionId")] - pub connection_id: String, - #[serde(rename = "displayType")] - pub display_type: ClickStackLineRawSqlChartConfigDisplaytype, - #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] - pub fill_nulls: Option, - #[serde(rename = "fitYAxisToData", skip_serializing_if = "Option::is_none")] - pub fit_y_axis_to_data: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate")] - pub sql_template: String, -} - -/// `ClickStackLineRawSqlChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackLineRawSqlChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackLineRawSqlChartConfigResponse { - #[serde( - rename = "alignDateRangeToGranularity", - skip_serializing_if = "Option::is_none" - )] - pub align_date_range_to_granularity: Option, - #[serde( - rename = "compareToPreviousPeriod", - skip_serializing_if = "Option::is_none" - )] - pub compare_to_previous_period: Option, - #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] - pub config_type: Option, - #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] - pub connection_id: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] - pub fill_nulls: Option, - #[serde(rename = "fitYAxisToData", skip_serializing_if = "Option::is_none")] - pub fit_y_axis_to_data: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] - pub sql_template: Option, -} - -/// `ClickStackLogSource` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackLogSource { - #[serde(rename = "bodyExpression", skip_serializing_if = "Option::is_none")] - pub body_expression: Option, - pub connection: String, - #[serde(rename = "defaultTableSelectExpression")] - pub default_table_select_expression: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - #[serde( - rename = "displayedTimestampValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub displayed_timestamp_value_expression: Option, - #[serde( - rename = "eventAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub event_attributes_expression: Option, - #[serde(rename = "filterSettings", skip_serializing_if = "Option::is_none")] - pub filter_settings: Option, - pub from: ClickStackSourceFrom, - #[serde( - rename = "highlightedRowAttributeExpressions", - skip_serializing_if = "Option::is_none" - )] - pub highlighted_row_attribute_expressions: - Option>, - #[serde( - rename = "highlightedTraceAttributeExpressions", - skip_serializing_if = "Option::is_none" - )] - pub highlighted_trace_attribute_expressions: - Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde( - rename = "implicitColumnExpression", - skip_serializing_if = "Option::is_none" - )] - pub implicit_column_expression: Option, - pub kind: ClickStackLogSourceKind, - #[serde( - rename = "knownColumnsListExpression", - skip_serializing_if = "Option::is_none" - )] - pub known_columns_list_expression: Option, - #[serde(rename = "materializedViews", skip_serializing_if = "Option::is_none")] - pub materialized_views: Option>, - #[serde( - rename = "metadataMaterializedViews", - skip_serializing_if = "Option::is_none" - )] - pub metadata_materialized_views: Option, - #[serde(rename = "metricSourceId", skip_serializing_if = "Option::is_none")] - pub metric_source_id: Option, - pub name: String, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde( - rename = "resourceAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub resource_attributes_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde( - rename = "serviceNameExpression", - skip_serializing_if = "Option::is_none" - )] - pub service_name_expression: Option, - #[serde( - rename = "severityTextExpression", - skip_serializing_if = "Option::is_none" - )] - pub severity_text_expression: Option, - #[serde(rename = "spanIdExpression", skip_serializing_if = "Option::is_none")] - pub span_id_expression: Option, - #[serde(rename = "timestampValueExpression")] - pub timestamp_value_expression: String, - #[serde(rename = "traceIdExpression", skip_serializing_if = "Option::is_none")] - pub trace_id_expression: Option, - #[serde(rename = "traceSourceId", skip_serializing_if = "Option::is_none")] - pub trace_source_id: Option, - #[serde( - rename = "useTextIndexForImplicitColumn", - skip_serializing_if = "Option::is_none" - )] - pub use_text_index_for_implicit_column: - Option, -} - -/// `ClickStackLogSource` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackLogSource`]: every field is `Option`, so -/// a field the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackLogSourceResponse { - #[serde(rename = "bodyExpression", skip_serializing_if = "Option::is_none")] - pub body_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub connection: Option, - #[serde( - rename = "defaultTableSelectExpression", - skip_serializing_if = "Option::is_none" - )] - pub default_table_select_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - #[serde( - rename = "displayedTimestampValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub displayed_timestamp_value_expression: Option, - #[serde( - rename = "eventAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub event_attributes_expression: Option, - #[serde(rename = "filterSettings", skip_serializing_if = "Option::is_none")] - pub filter_settings: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub from: Option, - #[serde( - rename = "highlightedRowAttributeExpressions", - skip_serializing_if = "Option::is_none" - )] - pub highlighted_row_attribute_expressions: - Option>, - #[serde( - rename = "highlightedTraceAttributeExpressions", - skip_serializing_if = "Option::is_none" - )] - pub highlighted_trace_attribute_expressions: - Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde( - rename = "implicitColumnExpression", - skip_serializing_if = "Option::is_none" - )] - pub implicit_column_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[serde( - rename = "knownColumnsListExpression", - skip_serializing_if = "Option::is_none" - )] - pub known_columns_list_expression: Option, - #[serde(rename = "materializedViews", skip_serializing_if = "Option::is_none")] - pub materialized_views: Option>, - #[serde( - rename = "metadataMaterializedViews", - skip_serializing_if = "Option::is_none" - )] - pub metadata_materialized_views: Option, - #[serde(rename = "metricSourceId", skip_serializing_if = "Option::is_none")] - pub metric_source_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde( - rename = "resourceAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub resource_attributes_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde( - rename = "serviceNameExpression", - skip_serializing_if = "Option::is_none" - )] - pub service_name_expression: Option, - #[serde( - rename = "severityTextExpression", - skip_serializing_if = "Option::is_none" - )] - pub severity_text_expression: Option, - #[serde(rename = "spanIdExpression", skip_serializing_if = "Option::is_none")] - pub span_id_expression: Option, - #[serde( - rename = "timestampValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub timestamp_value_expression: Option, - #[serde(rename = "traceIdExpression", skip_serializing_if = "Option::is_none")] - pub trace_id_expression: Option, - #[serde(rename = "traceSourceId", skip_serializing_if = "Option::is_none")] - pub trace_source_id: Option, - #[serde( - rename = "useTextIndexForImplicitColumn", - skip_serializing_if = "Option::is_none" - )] - pub use_text_index_for_implicit_column: - Option, -} - -/// `ClickStackLogSourceMetadataMaterializedViews` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackLogSourceMetadataMaterializedViews { - pub granularity: String, - #[serde(rename = "keyRollupTable")] - pub key_rollup_table: String, - #[serde(rename = "kvRollupTable")] - pub kv_rollup_table: String, -} - -/// `ClickStackLogSourceMetadataMaterializedViews` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackLogSourceMetadataMaterializedViews`]: every -/// field is `Option`, so a field the API drops or sends as `null` -/// deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackLogSourceMetadataMaterializedViewsResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub granularity: Option, - #[serde(rename = "keyRollupTable", skip_serializing_if = "Option::is_none")] - pub key_rollup_table: Option, - #[serde(rename = "kvRollupTable", skip_serializing_if = "Option::is_none")] - pub kv_rollup_table: Option, -} - -/// `ClickStackMarkdownChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMarkdownChartConfig { - #[serde(rename = "displayType")] - pub display_type: ClickStackMarkdownChartConfigDisplaytype, - #[serde(skip_serializing_if = "Option::is_none")] - pub markdown: Option, -} - -/// `ClickStackMarkdownChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackMarkdownChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMarkdownChartConfigResponse { - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub markdown: Option, -} - -/// `ClickStackMarkdownChartSeries` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMarkdownChartSeries { - pub content: String, - pub r#type: ClickStackMarkdownChartSeriesType, -} - -/// `ClickStackMaterializedView` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMaterializedView { - #[serde(rename = "aggregatedColumns")] - pub aggregated_columns: Vec, - #[serde(rename = "databaseName")] - pub database_name: String, - #[serde(rename = "dimensionColumns")] - pub dimension_columns: String, - #[serde(rename = "minDate", skip_serializing_if = "Option::is_none")] - pub min_date: Option>, - #[serde(rename = "minGranularity")] - pub min_granularity: ClickStackMaterializedViewMingranularity, - #[serde(rename = "tableName")] - pub table_name: String, - #[serde(rename = "timestampColumn")] - pub timestamp_column: String, -} - -/// `ClickStackMaterializedView` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackMaterializedView`]: every field is -/// `Option`, so a field the API drops or sends as `null` deserializes to -/// `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMaterializedViewResponse { - #[serde(rename = "aggregatedColumns", skip_serializing_if = "Option::is_none")] - pub aggregated_columns: Option>, - #[serde(rename = "databaseName", skip_serializing_if = "Option::is_none")] - pub database_name: Option, - #[serde(rename = "dimensionColumns", skip_serializing_if = "Option::is_none")] - pub dimension_columns: Option, - #[serde(rename = "minDate", skip_serializing_if = "Option::is_none")] - pub min_date: Option>, - #[serde(rename = "minGranularity", skip_serializing_if = "Option::is_none")] - pub min_granularity: Option, - #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] - pub table_name: Option, - #[serde(rename = "timestampColumn", skip_serializing_if = "Option::is_none")] - pub timestamp_column: Option, -} - -/// `ClickStackMetricSource` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMetricSource { - pub connection: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - pub from: ClickStackMetricSourceFrom, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - pub kind: ClickStackMetricSourceKind, - #[serde(rename = "logSourceId", skip_serializing_if = "Option::is_none")] - pub log_source_id: Option, - #[serde(rename = "metricTables")] - pub metric_tables: ClickStackMetricTables, - pub name: String, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde(rename = "resourceAttributesExpression")] - pub resource_attributes_expression: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde(rename = "timestampValueExpression")] - pub timestamp_value_expression: String, -} - -/// `ClickStackMetricSource` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackMetricSource`]: every field is `Option`, -/// so a field the API drops or sends as `null` deserializes to `None` instead -/// of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMetricSourceResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub connection: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub from: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[serde(rename = "logSourceId", skip_serializing_if = "Option::is_none")] - pub log_source_id: Option, - #[serde(rename = "metricTables", skip_serializing_if = "Option::is_none")] - pub metric_tables: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde( - rename = "resourceAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub resource_attributes_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde( - rename = "timestampValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub timestamp_value_expression: Option, -} - -/// `ClickStackMetricSourceFrom` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMetricSourceFrom { - #[serde(rename = "databaseName")] - pub database_name: String, - #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] - pub table_name: Option, -} - -/// `ClickStackMetricSourceFrom` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackMetricSourceFrom`]: every field is -/// `Option`, so a field the API drops or sends as `null` deserializes to -/// `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMetricSourceFromResponse { - #[serde(rename = "databaseName", skip_serializing_if = "Option::is_none")] - pub database_name: Option, - #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] - pub table_name: Option, -} - -/// `ClickStackMetricTables` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMetricTables { - #[serde(rename = "exponential histogram")] - pub exponential_histogram: String, - pub gauge: String, - pub histogram: String, - pub sum: String, - pub summary: String, -} - -/// `ClickStackMetricTables` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackMetricTables`]: every field is `Option`, -/// so a field the API drops or sends as `null` deserializes to `None` instead -/// of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackMetricTablesResponse { - #[serde( - rename = "exponential histogram", - skip_serializing_if = "Option::is_none" - )] - pub exponential_histogram: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub gauge: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub histogram: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub sum: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub summary: Option, -} - -/// `ClickStackNumberBuilderChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumberBuilderChartConfig { - #[serde(rename = "backgroundChart", skip_serializing_if = "Option::is_none")] - pub background_chart: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - #[serde(rename = "colorRules", skip_serializing_if = "Option::is_none")] - pub color_rules: Option>, - #[serde(rename = "displayType")] - pub display_type: ClickStackNumberBuilderChartConfigDisplaytype, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - pub select: Vec, - #[serde(rename = "sourceId")] - pub source_id: String, -} - -/// `ClickStackNumberBuilderChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackNumberBuilderChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumberBuilderChartConfigResponse { - #[serde(rename = "backgroundChart", skip_serializing_if = "Option::is_none")] - pub background_chart: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - #[serde(rename = "colorRules", skip_serializing_if = "Option::is_none")] - pub color_rules: Option>, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option>, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, -} - -/// `ClickStackNumberChartSeries` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumberChartSeries { - #[serde(rename = "aggFn")] - pub agg_fn: ClickStackNumberChartSeriesAggfn, - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub field: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub level: Option, - #[serde(rename = "metricDataType", skip_serializing_if = "Option::is_none")] - pub metric_data_type: Option, - #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] - pub metric_name: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId")] - pub source_id: String, - pub r#type: ClickStackNumberChartSeriesType, - pub r#where: String, - #[serde(rename = "whereLanguage")] - pub where_language: ClickStackNumberChartSeriesWherelanguage, -} - -/// `ClickStackNumberFormat` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumberFormat { - pub average: bool, - #[serde(rename = "currencySymbol")] - pub currency_symbol: String, - #[serde(rename = "decimalBytes")] - pub decimal_bytes: bool, - pub factor: f64, - pub mantissa: i64, - #[serde(rename = "numericUnit")] - pub numeric_unit: ClickStackNumberFormatNumericunit, - pub output: ClickStackNumberFormatOutput, - #[serde(rename = "thousandSeparated")] - pub thousand_separated: bool, - pub unit: String, -} - -/// `ClickStackNumberFormat` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackNumberFormat`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumberFormatResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub average: Option, - #[serde(rename = "currencySymbol", skip_serializing_if = "Option::is_none")] - pub currency_symbol: Option, - #[serde(rename = "decimalBytes", skip_serializing_if = "Option::is_none")] - pub decimal_bytes: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub factor: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub mantissa: Option, - #[serde(rename = "numericUnit", skip_serializing_if = "Option::is_none")] - pub numeric_unit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub output: Option, - #[serde(rename = "thousandSeparated", skip_serializing_if = "Option::is_none")] - pub thousand_separated: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub unit: Option, -} - -/// `ClickStackNumberRawSqlChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumberRawSqlChartConfig { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - #[serde(rename = "configType")] - pub config_type: ClickStackNumberRawSqlChartConfigConfigtype, - #[serde(rename = "connectionId")] - pub connection_id: String, - #[serde(rename = "displayType")] - pub display_type: ClickStackNumberRawSqlChartConfigDisplaytype, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate")] - pub sql_template: String, -} - -/// `ClickStackNumberRawSqlChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackNumberRawSqlChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumberRawSqlChartConfigResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] - pub config_type: Option, - #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] - pub connection_id: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] - pub sql_template: Option, -} - -/// `ClickStackNumericColorCondition` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumericColorCondition { - pub color: ClickStackChartColor, - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - pub operator: ClickStackNumericColorConditionOperator, - pub value: f64, -} - -/// `ClickStackNumericColorCondition` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackNumericColorCondition`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackNumericColorConditionResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub operator: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option, -} - -/// `ClickStackOnClickDashboard` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickDashboard { - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - pub target: ClickStackOnClickTarget, - pub r#type: ClickStackOnClickDashboardType, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, - #[serde(rename = "whereTemplate", skip_serializing_if = "Option::is_none")] - pub where_template: Option, -} - -/// `ClickStackOnClickDashboard` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackOnClickDashboard`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickDashboardResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub target: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, - #[serde(rename = "whereTemplate", skip_serializing_if = "Option::is_none")] - pub where_template: Option, -} - -/// `ClickStackOnClickExternal` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickExternal { - pub r#type: ClickStackOnClickExternalType, - #[serde(rename = "urlTemplate")] - pub url_template: String, -} - -/// `ClickStackOnClickExternal` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackOnClickExternal`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickExternalResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, - #[serde(rename = "urlTemplate", skip_serializing_if = "Option::is_none")] - pub url_template: Option, -} - -/// `ClickStackOnClickFilterTemplate` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickFilterTemplate { - pub expression: String, - pub kind: ClickStackOnClickFilterTemplateKind, - pub template: String, -} - -/// `ClickStackOnClickFilterTemplate` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackOnClickFilterTemplate`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickFilterTemplateResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub template: Option, -} - -/// `ClickStackOnClickSearch` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickSearch { - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - pub target: ClickStackOnClickTarget, - pub r#type: ClickStackOnClickSearchType, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, - #[serde(rename = "whereTemplate", skip_serializing_if = "Option::is_none")] - pub where_template: Option, -} - -/// `ClickStackOnClickSearch` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackOnClickSearch`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickSearchResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub target: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, - #[serde(rename = "whereTemplate", skip_serializing_if = "Option::is_none")] - pub where_template: Option, -} - -/// `ClickStackOnClickTargetIdVariant` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickTargetIdVariant { - pub id: String, - pub mode: ClickStackOnClickTargetIdVariantMode, -} - -/// `ClickStackOnClickTargetIdVariant` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackOnClickTargetIdVariant`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickTargetIdVariantResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub mode: Option, -} - -/// `ClickStackOnClickTargetTemplateVariant` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickTargetTemplateVariant { - pub mode: ClickStackOnClickTargetTemplateVariantMode, - pub template: String, -} - -/// `ClickStackOnClickTargetTemplateVariant` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackOnClickTargetTemplateVariant`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackOnClickTargetTemplateVariantResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub template: Option, -} - -/// `ClickStackPagerDutyAPIWebhook` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackPagerDutyAPIWebhook { - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub service: Option, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -/// `ClickStackPieBuilderChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackPieBuilderChartConfig { - #[serde(rename = "displayType")] - pub display_type: ClickStackPieBuilderChartConfigDisplaytype, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] - pub order_by: Option, - pub select: Vec, - #[serde(rename = "sourceId")] - pub source_id: String, -} - -/// `ClickStackPieBuilderChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackPieBuilderChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackPieBuilderChartConfigResponse { - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] - pub order_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option>, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, -} - -/// `ClickStackPieRawSqlChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackPieRawSqlChartConfig { - #[serde(rename = "configType")] - pub config_type: ClickStackPieRawSqlChartConfigConfigtype, - #[serde(rename = "connectionId")] - pub connection_id: String, - #[serde(rename = "displayType")] - pub display_type: ClickStackPieRawSqlChartConfigDisplaytype, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate")] - pub sql_template: String, -} - -/// `ClickStackPieRawSqlChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackPieRawSqlChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackPieRawSqlChartConfigResponse { - #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] - pub config_type: Option, - #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] - pub connection_id: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] - pub sql_template: Option, -} - -/// `ClickStackPromqlSource` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackPromqlSource { - pub connection: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - pub from: ClickStackSourceFrom, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - pub kind: ClickStackPromqlSourceKind, - pub name: String, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde(rename = "timestampValueExpression")] - pub timestamp_value_expression: String, -} - -/// `ClickStackPromqlSource` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackPromqlSource`]: every field is `Option`, -/// so a field the API drops or sends as `null` deserializes to `None` instead -/// of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackPromqlSourceResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub connection: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub from: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde( - rename = "timestampValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub timestamp_value_expression: Option, -} - -/// `ClickStackQuerySetting` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackQuerySetting { - pub setting: String, - pub value: String, -} - -/// `ClickStackQuerySetting` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackQuerySetting`]: every field is `Option`, -/// so a field the API drops or sends as `null` deserializes to `None` instead -/// of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackQuerySettingResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub setting: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option, -} - -/// `ClickStackRole` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackRole { - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "isPredefined", skip_serializing_if = "Option::is_none")] - pub is_predefined: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, -} - -/// `ClickStackSavedFilterValue` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSavedFilterValue { - pub condition: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -/// `ClickStackSavedFilterValue` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackSavedFilterValue`]: every field is -/// `Option`, so a field the API drops or sends as `null` deserializes to -/// `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSavedFilterValueResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub condition: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -/// `ClickStackSavedSearch` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSavedSearch { - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] - pub order_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub tags: Option>, - #[serde(rename = "teamId", skip_serializing_if = "Option::is_none")] - pub team_id: Option, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackSavedSearchFilter` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSavedSearchFilter { - pub condition: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -/// `ClickStackSavedSearchFilter` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackSavedSearchFilter`]: every field is -/// `Option`, so a field the API drops or sends as `null` deserializes to -/// `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSavedSearchFilterResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub condition: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -/// `ClickStackSavedSearchInput` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSavedSearchInput { - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - pub name: String, - #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] - pub order_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option, - #[serde(rename = "sourceId")] - pub source_id: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub tags: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackSearchChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSearchChartConfig { - #[serde(rename = "displayType")] - pub display_type: ClickStackSearchChartConfigDisplaytype, - pub select: String, - #[serde(rename = "sourceId")] - pub source_id: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage")] - pub where_language: ClickStackSearchChartConfigWherelanguage, -} - -/// `ClickStackSearchChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackSearchChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSearchChartConfigResponse { - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackSearchChartSeries` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSearchChartSeries { - pub fields: Vec, - #[serde(rename = "sourceId")] - pub source_id: String, - pub r#type: ClickStackSearchChartSeriesType, - pub r#where: String, - #[serde(rename = "whereLanguage")] - pub where_language: ClickStackSearchChartSeriesWherelanguage, -} - -/// `ClickStackSelectItem` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSelectItem { - #[serde(rename = "aggFn")] - pub agg_fn: ClickStackSelectItemAggfn, - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub level: Option, - #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] - pub metric_name: Option, - #[serde(rename = "metricType", skip_serializing_if = "Option::is_none")] - pub metric_type: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "periodAggFn", skip_serializing_if = "Option::is_none")] - pub period_agg_fn: Option, - #[serde(rename = "valueExpression", skip_serializing_if = "Option::is_none")] - pub value_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackSelectItem` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackSelectItem`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSelectItemResponse { - #[serde(rename = "aggFn", skip_serializing_if = "Option::is_none")] - pub agg_fn: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub level: Option, - #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] - pub metric_name: Option, - #[serde(rename = "metricType", skip_serializing_if = "Option::is_none")] - pub metric_type: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "periodAggFn", skip_serializing_if = "Option::is_none")] - pub period_agg_fn: Option, - #[serde(rename = "valueExpression", skip_serializing_if = "Option::is_none")] - pub value_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub r#where: Option, - #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] - pub where_language: Option, -} - -/// `ClickStackSessionSource` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSessionSource { - pub connection: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - pub from: ClickStackSourceFrom, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - pub kind: ClickStackSessionSourceKind, - pub name: String, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde( - rename = "timestampValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub timestamp_value_expression: Option, - #[serde(rename = "traceSourceId")] - pub trace_source_id: String, -} - -/// `ClickStackSessionSource` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackSessionSource`]: every field is `Option`, -/// so a field the API drops or sends as `null` deserializes to `None` instead -/// of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSessionSourceResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub connection: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub from: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde( - rename = "timestampValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub timestamp_value_expression: Option, - #[serde(rename = "traceSourceId", skip_serializing_if = "Option::is_none")] - pub trace_source_id: Option, -} - -/// `ClickStackSlackAPIWebhook` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSlackAPIWebhook { - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub service: Option, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -/// `ClickStackSlackWebhook` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSlackWebhook { - #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] - pub created_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub service: Option, - #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] - pub updated_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -/// `ClickStackSourceFilterSettings` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSourceFilterSettings { - pub columns: Vec, - #[serde(rename = "databaseName")] - pub database_name: String, - #[serde(rename = "tableName")] - pub table_name: String, -} - -/// `ClickStackSourceFilterSettings` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackSourceFilterSettings`]: every field is -/// `Option`, so a field the API drops or sends as `null` deserializes to -/// `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSourceFilterSettingsResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub columns: Option>, - #[serde(rename = "databaseName", skip_serializing_if = "Option::is_none")] - pub database_name: Option, - #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] - pub table_name: Option, -} - -/// `ClickStackSourceFrom` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSourceFrom { - #[serde(rename = "databaseName")] - pub database_name: String, - #[serde(rename = "tableName")] - pub table_name: String, -} - -/// `ClickStackSourceFrom` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackSourceFrom`]: every field is `Option`, so -/// a field the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackSourceFromResponse { - #[serde(rename = "databaseName", skip_serializing_if = "Option::is_none")] - pub database_name: Option, - #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] - pub table_name: Option, -} - -/// `ClickStackTableBuilderChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTableBuilderChartConfig { - #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] - pub as_ratio: Option, - #[serde(rename = "displayType")] - pub display_type: ClickStackTableBuilderChartConfigDisplaytype, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde( - rename = "groupByColumnsOnLeft", - skip_serializing_if = "Option::is_none" - )] - pub group_by_columns_on_left: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub having: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "onClick", skip_serializing_if = "Option::is_none")] - pub on_click: Option, - #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] - pub order_by: Option, - pub select: Vec, - #[serde(rename = "sourceId")] - pub source_id: String, -} - -/// `ClickStackTableBuilderChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackTableBuilderChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTableBuilderChartConfigResponse { - #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] - pub as_ratio: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - #[serde( - rename = "groupByColumnsOnLeft", - skip_serializing_if = "Option::is_none" - )] - pub group_by_columns_on_left: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub having: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "onClick", skip_serializing_if = "Option::is_none")] - pub on_click: Option, - #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] - pub order_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub select: Option>, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, -} - -/// `ClickStackTableChartSeries` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTableChartSeries { - #[serde(rename = "aggFn")] - pub agg_fn: ClickStackTableChartSeriesAggfn, - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub field: Option, - #[serde(rename = "groupBy")] - pub group_by: Vec, - #[serde(skip_serializing_if = "Option::is_none")] - pub level: Option, - #[serde(rename = "metricDataType", skip_serializing_if = "Option::is_none")] - pub metric_data_type: Option, - #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] - pub metric_name: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sortOrder", skip_serializing_if = "Option::is_none")] - pub sort_order: Option, - #[serde(rename = "sourceId")] - pub source_id: String, - pub r#type: ClickStackTableChartSeriesType, - pub r#where: String, - #[serde(rename = "whereLanguage")] - pub where_language: ClickStackTableChartSeriesWherelanguage, -} - -/// `ClickStackTableRawSqlChartConfig` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTableRawSqlChartConfig { - #[serde(rename = "configType")] - pub config_type: ClickStackTableRawSqlChartConfigConfigtype, - #[serde(rename = "connectionId")] - pub connection_id: String, - #[serde(rename = "displayType")] - pub display_type: ClickStackTableRawSqlChartConfigDisplaytype, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "onClick", skip_serializing_if = "Option::is_none")] - pub on_click: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate")] - pub sql_template: String, -} - -/// `ClickStackTableRawSqlChartConfig` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackTableRawSqlChartConfig`]: every field is `Option`, so a field -/// the API drops or sends as `null` deserializes to `None` instead of -/// failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTableRawSqlChartConfigResponse { - #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] - pub config_type: Option, - #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] - pub connection_id: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "onClick", skip_serializing_if = "Option::is_none")] - pub on_click: Option, - #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] - pub source_id: Option, - #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] - pub sql_template: Option, -} - -/// `ClickStackTileInput` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTileInput { - #[cfg(feature = "deprecated-fields")] - #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] - pub as_ratio: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub config: Option, - #[serde(rename = "containerId", skip_serializing_if = "Option::is_none")] - pub container_id: Option, - pub h: i64, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - pub name: String, - #[cfg(feature = "deprecated-fields")] - #[serde(skip_serializing_if = "Option::is_none")] - pub series: Option>, - #[serde(rename = "tabId", skip_serializing_if = "Option::is_none")] - pub tab_id: Option, - pub w: i64, - pub x: i64, - pub y: i64, -} - -/// `ClickStackTileOutput` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTileOutput { - #[serde(skip_serializing_if = "Option::is_none")] - pub config: Option, - #[serde(rename = "containerId", skip_serializing_if = "Option::is_none")] - pub container_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub h: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "tabId", skip_serializing_if = "Option::is_none")] - pub tab_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub w: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub x: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub y: Option, -} - -/// `ClickStackTimeChartSeries` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTimeChartSeries { - #[serde(rename = "aggFn")] - pub agg_fn: ClickStackTimeChartSeriesAggfn, - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] - pub display_type: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub field: Option, - #[serde(rename = "groupBy")] - pub group_by: Vec, - #[serde(skip_serializing_if = "Option::is_none")] - pub level: Option, - #[serde(rename = "metricDataType", skip_serializing_if = "Option::is_none")] - pub metric_data_type: Option, - #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] - pub metric_name: Option, - #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] - pub number_format: Option, - #[serde(rename = "sourceId")] - pub source_id: String, - pub r#type: ClickStackTimeChartSeriesType, - pub r#where: String, - #[serde(rename = "whereLanguage")] - pub where_language: ClickStackTimeChartSeriesWherelanguage, -} - -/// `ClickStackTraceSource` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTraceSource { - pub connection: String, - #[serde(rename = "defaultTableSelectExpression")] - pub default_table_select_expression: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - #[serde(rename = "durationExpression")] - pub duration_expression: String, - #[serde(rename = "durationPrecision")] - pub duration_precision: i64, - #[serde( - rename = "eventAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub event_attributes_expression: Option, - #[serde(rename = "filterSettings", skip_serializing_if = "Option::is_none")] - pub filter_settings: Option, - pub from: ClickStackSourceFrom, - #[serde( - rename = "highlightedRowAttributeExpressions", - skip_serializing_if = "Option::is_none" - )] - pub highlighted_row_attribute_expressions: - Option>, - #[serde( - rename = "highlightedTraceAttributeExpressions", - skip_serializing_if = "Option::is_none" - )] - pub highlighted_trace_attribute_expressions: - Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde( - rename = "implicitColumnExpression", - skip_serializing_if = "Option::is_none" - )] - pub implicit_column_expression: Option, - pub kind: ClickStackTraceSourceKind, - #[serde( - rename = "knownColumnsListExpression", - skip_serializing_if = "Option::is_none" - )] - pub known_columns_list_expression: Option, - #[serde(rename = "logSourceId", skip_serializing_if = "Option::is_none")] - pub log_source_id: Option, - #[serde(rename = "materializedViews", skip_serializing_if = "Option::is_none")] - pub materialized_views: Option>, - #[serde( - rename = "metadataMaterializedViews", - skip_serializing_if = "Option::is_none" - )] - pub metadata_materialized_views: Option, - #[serde(rename = "metricSourceId", skip_serializing_if = "Option::is_none")] - pub metric_source_id: Option, - pub name: String, - #[serde(rename = "parentSpanIdExpression")] - pub parent_span_id_expression: String, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde( - rename = "resourceAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub resource_attributes_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde( - rename = "serviceNameExpression", - skip_serializing_if = "Option::is_none" - )] - pub service_name_expression: Option, - #[serde(rename = "sessionSourceId", skip_serializing_if = "Option::is_none")] - pub session_source_id: Option, - #[serde( - rename = "spanEventsValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub span_events_value_expression: Option, - #[serde(rename = "spanIdExpression")] - pub span_id_expression: String, - #[serde(rename = "spanKindExpression")] - pub span_kind_expression: String, - #[serde(rename = "spanNameExpression")] - pub span_name_expression: String, - #[serde( - rename = "statusCodeExpression", - skip_serializing_if = "Option::is_none" - )] - pub status_code_expression: Option, - #[serde( - rename = "statusMessageExpression", - skip_serializing_if = "Option::is_none" - )] - pub status_message_expression: Option, - #[serde(rename = "timestampValueExpression")] - pub timestamp_value_expression: String, - #[serde(rename = "traceIdExpression")] - pub trace_id_expression: String, - #[serde( - rename = "useTextIndexForImplicitColumn", - skip_serializing_if = "Option::is_none" - )] - pub use_text_index_for_implicit_column: - Option, -} - -/// `ClickStackTraceSource` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackTraceSource`]: every field is `Option`, -/// so a field the API drops or sends as `null` deserializes to `None` instead -/// of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTraceSourceResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub connection: Option, - #[serde( - rename = "defaultTableSelectExpression", - skip_serializing_if = "Option::is_none" - )] - pub default_table_select_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - #[serde(rename = "durationExpression", skip_serializing_if = "Option::is_none")] - pub duration_expression: Option, - #[serde(rename = "durationPrecision", skip_serializing_if = "Option::is_none")] - pub duration_precision: Option, - #[serde( - rename = "eventAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub event_attributes_expression: Option, - #[serde(rename = "filterSettings", skip_serializing_if = "Option::is_none")] - pub filter_settings: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub from: Option, - #[serde( - rename = "highlightedRowAttributeExpressions", - skip_serializing_if = "Option::is_none" - )] - pub highlighted_row_attribute_expressions: - Option>, - #[serde( - rename = "highlightedTraceAttributeExpressions", - skip_serializing_if = "Option::is_none" - )] - pub highlighted_trace_attribute_expressions: - Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde( - rename = "implicitColumnExpression", - skip_serializing_if = "Option::is_none" - )] - pub implicit_column_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[serde( - rename = "knownColumnsListExpression", - skip_serializing_if = "Option::is_none" - )] - pub known_columns_list_expression: Option, - #[serde(rename = "logSourceId", skip_serializing_if = "Option::is_none")] - pub log_source_id: Option, - #[serde(rename = "materializedViews", skip_serializing_if = "Option::is_none")] - pub materialized_views: Option>, - #[serde( - rename = "metadataMaterializedViews", - skip_serializing_if = "Option::is_none" - )] - pub metadata_materialized_views: Option, - #[serde(rename = "metricSourceId", skip_serializing_if = "Option::is_none")] - pub metric_source_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde( - rename = "parentSpanIdExpression", - skip_serializing_if = "Option::is_none" - )] - pub parent_span_id_expression: Option, - #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] - pub query_settings: Option>, - #[serde( - rename = "resourceAttributesExpression", - skip_serializing_if = "Option::is_none" - )] - pub resource_attributes_expression: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub section: Option, - #[serde( - rename = "serviceNameExpression", - skip_serializing_if = "Option::is_none" - )] - pub service_name_expression: Option, - #[serde(rename = "sessionSourceId", skip_serializing_if = "Option::is_none")] - pub session_source_id: Option, - #[serde( - rename = "spanEventsValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub span_events_value_expression: Option, - #[serde(rename = "spanIdExpression", skip_serializing_if = "Option::is_none")] - pub span_id_expression: Option, - #[serde(rename = "spanKindExpression", skip_serializing_if = "Option::is_none")] - pub span_kind_expression: Option, - #[serde(rename = "spanNameExpression", skip_serializing_if = "Option::is_none")] - pub span_name_expression: Option, - #[serde( - rename = "statusCodeExpression", - skip_serializing_if = "Option::is_none" - )] - pub status_code_expression: Option, - #[serde( - rename = "statusMessageExpression", - skip_serializing_if = "Option::is_none" - )] - pub status_message_expression: Option, - #[serde( - rename = "timestampValueExpression", - skip_serializing_if = "Option::is_none" - )] - pub timestamp_value_expression: Option, - #[serde(rename = "traceIdExpression", skip_serializing_if = "Option::is_none")] - pub trace_id_expression: Option, - #[serde( - rename = "useTextIndexForImplicitColumn", - skip_serializing_if = "Option::is_none" - )] - pub use_text_index_for_implicit_column: - Option, -} - -/// `ClickStackTraceSourceMetadataMaterializedViews` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTraceSourceMetadataMaterializedViews { - pub granularity: String, - #[serde(rename = "keyRollupTable")] - pub key_rollup_table: String, - #[serde(rename = "kvRollupTable")] - pub kv_rollup_table: String, -} - -/// `ClickStackTraceSourceMetadataMaterializedViews` from the ClickHouse Cloud API, in response position. -/// -/// Response variant of [`ClickStackTraceSourceMetadataMaterializedViews`]: -/// every field is `Option`, so a field the API drops or sends as `null` -/// deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackTraceSourceMetadataMaterializedViewsResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub granularity: Option, - #[serde(rename = "keyRollupTable", skip_serializing_if = "Option::is_none")] - pub key_rollup_table: Option, - #[serde(rename = "kvRollupTable", skip_serializing_if = "Option::is_none")] - pub kv_rollup_table: Option, -} - -/// `ClickStackUpdateAlertRequest` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackUpdateAlertRequest { - pub channel: ClickStackAlertChannel, - #[serde(rename = "dashboardId", skip_serializing_if = "Option::is_none")] - pub dashboard_id: Option, - #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] - pub group_by: Option, - pub interval: ClickStackUpdateAlertRequestInterval, - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub note: Option, - #[serde( - rename = "numConsecutiveWindows", - skip_serializing_if = "Option::is_none" - )] - pub num_consecutive_windows: Option, - #[serde(rename = "savedSearchId", skip_serializing_if = "Option::is_none")] - pub saved_search_id: Option, - #[serde( - rename = "scheduleOffsetMinutes", - skip_serializing_if = "Option::is_none" - )] - pub schedule_offset_minutes: Option, - #[serde(rename = "scheduleStartAt", skip_serializing_if = "Option::is_none")] - pub schedule_start_at: Option>, - pub source: ClickStackUpdateAlertRequestSource, - pub threshold: f64, - #[serde(rename = "thresholdMax", skip_serializing_if = "Option::is_none")] - pub threshold_max: Option, - #[serde(rename = "thresholdType")] - pub threshold_type: ClickStackUpdateAlertRequestThresholdtype, - #[serde(rename = "tileId", skip_serializing_if = "Option::is_none")] - pub tile_id: Option, -} - -/// `ClickStackUpdateConnectionRequest` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackUpdateConnectionRequest { - pub host: String, - #[serde( - rename = "hyperdxSettingPrefix", - skip_serializing_if = "Option::is_none" - )] - pub hyperdx_setting_prefix: Option, - #[serde( - rename = "isPrometheusEndpoint", - skip_serializing_if = "Option::is_none" - )] - pub is_prometheus_endpoint: Option, - pub name: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub password: Option, - pub username: String, -} - -/// `ClickStackUpdateDashboardRequest` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackUpdateDashboardRequest { - #[serde(skip_serializing_if = "Option::is_none")] - pub containers: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option>, - pub name: String, - #[serde(rename = "savedFilterValues", skip_serializing_if = "Option::is_none")] - pub saved_filter_values: Option>, - #[serde(rename = "savedQuery", skip_serializing_if = "Option::is_none")] - pub saved_query: Option, - #[serde(rename = "savedQueryLanguage", skip_serializing_if = "Option::is_none")] - pub saved_query_language: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub tags: Option>, - pub tiles: Vec, -} - -/// `ClickStackUpdateRoleRequest` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackUpdateRoleRequest { - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - pub permissions: Vec, -} - -/// `ClickStackValidateDashboardError` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackValidateDashboardError { - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub path: Option, -} - -/// `ClickStackValidateDashboardResponse` from the ClickHouse Cloud API. -/// -/// Used in response position only: every field is `Option`, so a field the -/// API drops or sends as `null` deserializes to `None` instead of failing. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackValidateDashboardResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub errors: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub normalized: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub valid: Option, -} - -/// `ClickStackWebhookInput` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickStackWebhookInput { - #[serde(skip_serializing_if = "Option::is_none")] - pub body: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub headers: Option, - pub name: String, - #[serde(rename = "queryParams", skip_serializing_if = "Option::is_none")] - pub query_params: Option, - pub service: ClickStackWebhookInputService, - pub url: String, -} - -impl Default for ClickStackAlertChannel { - fn default() -> Self { - Self::ClickStackAlertChannelEmail(ClickStackAlertChannelEmail::default()) - } -} - -impl Default for ClickStackBarChartConfig { - fn default() -> Self { - Self::ClickStackBarBuilderChartConfig(ClickStackBarBuilderChartConfig::default()) - } -} - -impl Default for ClickStackDashboardChartSeries { - fn default() -> Self { - Self::ClickStackTimeChartSeries(ClickStackTimeChartSeries::default()) - } -} - -impl Default for ClickStackLineChartConfig { - fn default() -> Self { - Self::ClickStackLineBuilderChartConfig(ClickStackLineBuilderChartConfig::default()) - } -} - -impl Default for ClickStackNumberChartConfig { - fn default() -> Self { - Self::ClickStackNumberBuilderChartConfig(ClickStackNumberBuilderChartConfig::default()) - } -} - -impl Default for ClickStackPieChartConfig { - fn default() -> Self { - Self::ClickStackPieBuilderChartConfig(ClickStackPieBuilderChartConfig::default()) - } -} - -impl Default for ClickStackSource { - fn default() -> Self { - Self::ClickStackLogSource(ClickStackLogSource::default()) - } -} - -impl Default for ClickStackTableChartConfig { - fn default() -> Self { - Self::ClickStackTableBuilderChartConfig(ClickStackTableBuilderChartConfig::default()) - } -} - -impl Default for ClickStackTileConfig { - fn default() -> Self { - Self::ClickStackLineChartConfig(ClickStackLineChartConfig::default()) - } -} - -impl Default for ClickStackWebhook { - fn default() -> Self { - // Every field of this response-only union's variants is `Option`, - // so the derived `ClickStackSlackWebhook::default()` leaves `service` - // absent and serializes to `{}` — which deserializes back through the - // discriminator dispatch as `Unknown`, not as this variant. Naming the - // variant's own wire value keeps the default round-tripping. - Self::ClickStackSlackWebhook(ClickStackSlackWebhook { - service: Some(ClickStackSlackWebhookService::default()), - ..ClickStackSlackWebhook::default() - }) - } -} diff --git a/crates/clickhouse-cloud-api/src/models/clickstack.rs b/crates/clickhouse-cloud-api/src/models/clickstack.rs new file mode 100644 index 0000000..f92a8f1 --- /dev/null +++ b/crates/clickhouse-cloud-api/src/models/clickstack.rs @@ -0,0 +1,4199 @@ +use super::clickstack_enums::*; +use serde::{Deserialize, Serialize}; + +/// `ClickStackAlertChannel` - one of multiple variants. +/// +/// Dispatched on the `type` field; see the `discriminated_union!` +/// invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackAlertChannel { + ClickStackAlertChannelEmail(ClickStackAlertChannelEmail), + ClickStackAlertChannelWebhook(ClickStackAlertChannelWebhook), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackAlertChannel, "type" { + "email" => ClickStackAlertChannelEmail, + "webhook" => ClickStackAlertChannelWebhook, + } +} + +impl std::fmt::Display for ClickStackAlertChannel { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackAlertChannelEmail(_) => write!(f, "ClickStackAlertChannelEmail"), + Self::ClickStackAlertChannelWebhook(_) => write!(f, "ClickStackAlertChannelWebhook"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackAlertChannel` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackAlertChannel`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `type` field, exactly as the request union is: dispatch +/// reads the raw JSON rather than trying each variant's shape, so all-`Option` +/// arms — which would match any object under `untagged` matching — cannot +/// misroute a payload. A `type` this crate does not know, or a payload that +/// does not fit the variant its `type` selects, lands in `Unknown` with the +/// raw JSON intact. +/// +/// Deliberately has no `Default`: every arm's default would serialize to `{}`, +/// which carries no `type` and so would not deserialize back to the same +/// variant. Build a [`ClickStackAlertChannel`] instead when writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackAlertChannelResponse { + ClickStackAlertChannelEmail(ClickStackAlertChannelEmailResponse), + ClickStackAlertChannelWebhook(ClickStackAlertChannelWebhookResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackAlertChannelResponse, "type" { + "email" => ClickStackAlertChannelEmail, + "webhook" => ClickStackAlertChannelWebhook, + } +} + +impl std::fmt::Display for ClickStackAlertChannelResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackAlertChannelEmail(_) => write!(f, "ClickStackAlertChannelEmail"), + Self::ClickStackAlertChannelWebhook(_) => write!(f, "ClickStackAlertChannelWebhook"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackBarChartConfig` - one of multiple variants. +/// +/// Dispatched on the `configType` field (absent or non-string dispatches to the +/// builder variant, unless the payload carries a raw-SQL-only key); see the +/// `discriminated_union!` invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackBarChartConfig { + ClickStackBarBuilderChartConfig(ClickStackBarBuilderChartConfig), + ClickStackBarRawSqlChartConfig(ClickStackBarRawSqlChartConfig), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackBarChartConfig, "configType" { + "sql" => ClickStackBarRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackBarBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackBarChartConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackBarBuilderChartConfig(_) => { + write!(f, "ClickStackBarBuilderChartConfig") + } + Self::ClickStackBarRawSqlChartConfig(_) => write!(f, "ClickStackBarRawSqlChartConfig"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackBarChartConfig` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackBarChartConfig`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `configType` field exactly as the request union is (absent +/// or non-string dispatches to the builder variant, unless the payload carries +/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each +/// variant's shape, so all-`Option` arms — which would match any object under +/// `untagged` matching — cannot misroute a payload, and the `unless` guard +/// keeps a raw-SQL payload with a dropped discriminator out of the total +/// builder arm. A payload that does not fit the variant its discriminator +/// selects lands in `Unknown` with the raw JSON intact. +/// +/// Deliberately has no `Default`: response values are produced by +/// deserialization, never constructed; build a [`ClickStackBarChartConfig`] instead when +/// writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackBarChartConfigResponse { + ClickStackBarRawSqlChartConfig(ClickStackBarRawSqlChartConfigResponse), + ClickStackBarBuilderChartConfig(ClickStackBarBuilderChartConfigResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackBarChartConfigResponse, "configType" { + "sql" => ClickStackBarRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackBarBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackBarChartConfigResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackBarRawSqlChartConfig(_) => write!(f, "ClickStackBarRawSqlChartConfig"), + Self::ClickStackBarBuilderChartConfig(_) => { + write!(f, "ClickStackBarBuilderChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackCategoricalBarChartConfig` - one of multiple variants. +/// +/// Dispatched on the `configType` field (absent or non-string dispatches to the +/// builder variant, unless the payload carries a raw-SQL-only key); see the +/// `discriminated_union!` invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackCategoricalBarChartConfig { + ClickStackCategoricalBarBuilderChartConfig(ClickStackCategoricalBarBuilderChartConfig), + ClickStackCategoricalBarRawSqlChartConfig(ClickStackCategoricalBarRawSqlChartConfig), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackCategoricalBarChartConfig, "configType" { + "sql" => ClickStackCategoricalBarRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackCategoricalBarBuilderChartConfig, + } +} + +impl Default for ClickStackCategoricalBarChartConfig { + fn default() -> Self { + Self::ClickStackCategoricalBarBuilderChartConfig( + ClickStackCategoricalBarBuilderChartConfig::default(), + ) + } +} + +impl std::fmt::Display for ClickStackCategoricalBarChartConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackCategoricalBarBuilderChartConfig(_) => { + write!(f, "ClickStackCategoricalBarBuilderChartConfig") + } + Self::ClickStackCategoricalBarRawSqlChartConfig(_) => { + write!(f, "ClickStackCategoricalBarRawSqlChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackCategoricalBarChartConfig` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackCategoricalBarChartConfig`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `configType` field exactly as the request union is (absent +/// or non-string dispatches to the builder variant, unless the payload carries +/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each +/// variant's shape, so all-`Option` arms — which would match any object under +/// `untagged` matching — cannot misroute a payload, and the `unless` guard +/// keeps a raw-SQL payload with a dropped discriminator out of the total +/// builder arm. A payload that does not fit the variant its discriminator +/// selects lands in `Unknown` with the raw JSON intact. +/// +/// Deliberately has no `Default`: response values are produced by +/// deserialization, never constructed; build a [`ClickStackCategoricalBarChartConfig`] instead when +/// writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackCategoricalBarChartConfigResponse { + ClickStackCategoricalBarRawSqlChartConfig(ClickStackCategoricalBarRawSqlChartConfigResponse), + ClickStackCategoricalBarBuilderChartConfig(ClickStackCategoricalBarBuilderChartConfigResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackCategoricalBarChartConfigResponse, "configType" { + "sql" => ClickStackCategoricalBarRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackCategoricalBarBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackCategoricalBarChartConfigResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackCategoricalBarRawSqlChartConfig(_) => { + write!(f, "ClickStackCategoricalBarRawSqlChartConfig") + } + Self::ClickStackCategoricalBarBuilderChartConfig(_) => { + write!(f, "ClickStackCategoricalBarBuilderChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackDashboardChartSeries` - one of multiple variants. +/// +/// Dispatched on the `type` field; see the `discriminated_union!` +/// invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackDashboardChartSeries { + ClickStackTimeChartSeries(ClickStackTimeChartSeries), + ClickStackTableChartSeries(ClickStackTableChartSeries), + ClickStackNumberChartSeries(ClickStackNumberChartSeries), + ClickStackSearchChartSeries(ClickStackSearchChartSeries), + ClickStackMarkdownChartSeries(ClickStackMarkdownChartSeries), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackDashboardChartSeries, "type" { + "time" => ClickStackTimeChartSeries, + "table" => ClickStackTableChartSeries, + "number" => ClickStackNumberChartSeries, + "search" => ClickStackSearchChartSeries, + "markdown" => ClickStackMarkdownChartSeries, + } +} + +impl std::fmt::Display for ClickStackDashboardChartSeries { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackTimeChartSeries(_) => write!(f, "ClickStackTimeChartSeries"), + Self::ClickStackTableChartSeries(_) => write!(f, "ClickStackTableChartSeries"), + Self::ClickStackNumberChartSeries(_) => write!(f, "ClickStackNumberChartSeries"), + Self::ClickStackSearchChartSeries(_) => write!(f, "ClickStackSearchChartSeries"), + Self::ClickStackMarkdownChartSeries(_) => write!(f, "ClickStackMarkdownChartSeries"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackLineChartConfig` - one of multiple variants. +/// +/// Dispatched on the `configType` field (absent or non-string dispatches to the +/// builder variant, unless the payload carries a raw-SQL-only key); see the +/// `discriminated_union!` invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackLineChartConfig { + ClickStackLineBuilderChartConfig(ClickStackLineBuilderChartConfig), + ClickStackLineRawSqlChartConfig(ClickStackLineRawSqlChartConfig), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackLineChartConfig, "configType" { + "sql" => ClickStackLineRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackLineBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackLineChartConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackLineBuilderChartConfig(_) => { + write!(f, "ClickStackLineBuilderChartConfig") + } + Self::ClickStackLineRawSqlChartConfig(_) => { + write!(f, "ClickStackLineRawSqlChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackLineChartConfig` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackLineChartConfig`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `configType` field exactly as the request union is (absent +/// or non-string dispatches to the builder variant, unless the payload carries +/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each +/// variant's shape, so all-`Option` arms — which would match any object under +/// `untagged` matching — cannot misroute a payload, and the `unless` guard +/// keeps a raw-SQL payload with a dropped discriminator out of the total +/// builder arm. A payload that does not fit the variant its discriminator +/// selects lands in `Unknown` with the raw JSON intact. +/// +/// Deliberately has no `Default`: response values are produced by +/// deserialization, never constructed; build a [`ClickStackLineChartConfig`] instead when +/// writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackLineChartConfigResponse { + ClickStackLineRawSqlChartConfig(ClickStackLineRawSqlChartConfigResponse), + ClickStackLineBuilderChartConfig(ClickStackLineBuilderChartConfigResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackLineChartConfigResponse, "configType" { + "sql" => ClickStackLineRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackLineBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackLineChartConfigResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackLineRawSqlChartConfig(_) => { + write!(f, "ClickStackLineRawSqlChartConfig") + } + Self::ClickStackLineBuilderChartConfig(_) => { + write!(f, "ClickStackLineBuilderChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackNumberChartConfig` - one of multiple variants. +/// +/// Dispatched on the `configType` field (absent or non-string dispatches to the +/// builder variant, unless the payload carries a raw-SQL-only key); see the +/// `discriminated_union!` invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackNumberChartConfig { + ClickStackNumberBuilderChartConfig(ClickStackNumberBuilderChartConfig), + ClickStackNumberRawSqlChartConfig(ClickStackNumberRawSqlChartConfig), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackNumberChartConfig, "configType" { + "sql" => ClickStackNumberRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackNumberBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackNumberChartConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackNumberBuilderChartConfig(_) => { + write!(f, "ClickStackNumberBuilderChartConfig") + } + Self::ClickStackNumberRawSqlChartConfig(_) => { + write!(f, "ClickStackNumberRawSqlChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackNumberChartConfig` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackNumberChartConfig`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `configType` field exactly as the request union is (absent +/// or non-string dispatches to the builder variant, unless the payload carries +/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each +/// variant's shape, so all-`Option` arms — which would match any object under +/// `untagged` matching — cannot misroute a payload, and the `unless` guard +/// keeps a raw-SQL payload with a dropped discriminator out of the total +/// builder arm. A payload that does not fit the variant its discriminator +/// selects lands in `Unknown` with the raw JSON intact. +/// +/// Deliberately has no `Default`: response values are produced by +/// deserialization, never constructed; build a [`ClickStackNumberChartConfig`] instead when +/// writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackNumberChartConfigResponse { + ClickStackNumberRawSqlChartConfig(ClickStackNumberRawSqlChartConfigResponse), + ClickStackNumberBuilderChartConfig(ClickStackNumberBuilderChartConfigResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackNumberChartConfigResponse, "configType" { + "sql" => ClickStackNumberRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackNumberBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackNumberChartConfigResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackNumberRawSqlChartConfig(_) => { + write!(f, "ClickStackNumberRawSqlChartConfig") + } + Self::ClickStackNumberBuilderChartConfig(_) => { + write!(f, "ClickStackNumberBuilderChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackNumberTileColorCondition` - one of multiple variants. +/// +/// Dispatched on the `operator` field; see the `discriminated_union!` +/// invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackNumberTileColorCondition { + ClickStackNumericColorCondition(ClickStackNumericColorCondition), + ClickStackBetweenColorCondition(ClickStackBetweenColorCondition), + ClickStackEqualityColorCondition(ClickStackEqualityColorCondition), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackNumberTileColorCondition, "operator" { + "gt" | "gte" | "lt" | "lte" => ClickStackNumericColorCondition, + "between" => ClickStackBetweenColorCondition, + "eq" | "neq" => ClickStackEqualityColorCondition, + } +} + +impl std::fmt::Display for ClickStackNumberTileColorCondition { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackNumericColorCondition(_) => { + write!(f, "ClickStackNumericColorCondition") + } + Self::ClickStackBetweenColorCondition(_) => { + write!(f, "ClickStackBetweenColorCondition") + } + Self::ClickStackEqualityColorCondition(_) => { + write!(f, "ClickStackEqualityColorCondition") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackNumberTileColorCondition` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackNumberTileColorCondition`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `operator` field, exactly as the request union is: dispatch +/// reads the raw JSON rather than trying each variant's shape, so all-`Option` +/// arms — which would match any object under `untagged` matching — cannot +/// misroute a payload. A `operator` this crate does not know, or a payload that +/// does not fit the variant its `operator` selects, lands in `Unknown` with the +/// raw JSON intact. +/// +/// Deliberately has no `Default`: every arm's default would serialize to `{}`, +/// which carries no `operator` and so would not deserialize back to the same +/// variant. Build a [`ClickStackNumberTileColorCondition`] instead when writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackNumberTileColorConditionResponse { + ClickStackNumericColorCondition(ClickStackNumericColorConditionResponse), + ClickStackBetweenColorCondition(ClickStackBetweenColorConditionResponse), + ClickStackEqualityColorCondition(ClickStackEqualityColorConditionResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackNumberTileColorConditionResponse, "operator" { + "gt" | "gte" | "lt" | "lte" => ClickStackNumericColorCondition, + "between" => ClickStackBetweenColorCondition, + "eq" | "neq" => ClickStackEqualityColorCondition, + } +} + +impl std::fmt::Display for ClickStackNumberTileColorConditionResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackNumericColorCondition(_) => { + write!(f, "ClickStackNumericColorCondition") + } + Self::ClickStackBetweenColorCondition(_) => { + write!(f, "ClickStackBetweenColorCondition") + } + Self::ClickStackEqualityColorCondition(_) => { + write!(f, "ClickStackEqualityColorCondition") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackOnClick` - one of multiple variants. +/// +/// Dispatched on the `type` field; see the `discriminated_union!` +/// invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackOnClick { + ClickStackOnClickSearch(ClickStackOnClickSearch), + ClickStackOnClickDashboard(ClickStackOnClickDashboard), + ClickStackOnClickExternal(ClickStackOnClickExternal), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackOnClick, "type" { + "search" => ClickStackOnClickSearch, + "dashboard" => ClickStackOnClickDashboard, + "external" => ClickStackOnClickExternal, + } +} + +impl Default for ClickStackOnClick { + fn default() -> Self { + Self::Unknown(serde_json::Value::Null) + } +} + +impl std::fmt::Display for ClickStackOnClick { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackOnClickSearch(_) => write!(f, "ClickStackOnClickSearch"), + Self::ClickStackOnClickDashboard(_) => write!(f, "ClickStackOnClickDashboard"), + Self::ClickStackOnClickExternal(_) => write!(f, "ClickStackOnClickExternal"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackOnClick` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackOnClick`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `type` field, exactly as the request union is: dispatch +/// reads the raw JSON rather than trying each variant's shape, so all-`Option` +/// arms — which would match any object under `untagged` matching — cannot +/// misroute a payload. A `type` this crate does not know, or a payload that +/// does not fit the variant its `type` selects, lands in `Unknown` with the +/// raw JSON intact. +/// +/// Deliberately has no `Default`: every arm's default would serialize to `{}`, +/// which carries no `type` and so would not deserialize back to the same +/// variant. Build a [`ClickStackOnClick`] instead when writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackOnClickResponse { + ClickStackOnClickSearch(ClickStackOnClickSearchResponse), + ClickStackOnClickDashboard(ClickStackOnClickDashboardResponse), + ClickStackOnClickExternal(ClickStackOnClickExternalResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackOnClickResponse, "type" { + "search" => ClickStackOnClickSearch, + "dashboard" => ClickStackOnClickDashboard, + "external" => ClickStackOnClickExternal, + } +} + +impl std::fmt::Display for ClickStackOnClickResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackOnClickSearch(_) => write!(f, "ClickStackOnClickSearch"), + Self::ClickStackOnClickDashboard(_) => write!(f, "ClickStackOnClickDashboard"), + Self::ClickStackOnClickExternal(_) => write!(f, "ClickStackOnClickExternal"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackOnClickTarget` - one of multiple variants. +/// +/// Dispatched on the `mode` field; see the `discriminated_union!` +/// invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackOnClickTarget { + ClickStackOnClickTargetIdVariant(ClickStackOnClickTargetIdVariant), + ClickStackOnClickTargetTemplateVariant(ClickStackOnClickTargetTemplateVariant), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackOnClickTarget, "mode" { + "id" => ClickStackOnClickTargetIdVariant, + "template" => ClickStackOnClickTargetTemplateVariant, + } +} + +impl Default for ClickStackOnClickTarget { + fn default() -> Self { + Self::Unknown(serde_json::Value::Null) + } +} + +impl std::fmt::Display for ClickStackOnClickTarget { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackOnClickTargetIdVariant(_) => { + write!(f, "ClickStackOnClickTargetIdVariant") + } + Self::ClickStackOnClickTargetTemplateVariant(_) => { + write!(f, "ClickStackOnClickTargetTemplateVariant") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackOnClickTarget` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackOnClickTarget`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `mode` field, exactly as the request union is: dispatch +/// reads the raw JSON rather than trying each variant's shape, so all-`Option` +/// arms — which would match any object under `untagged` matching — cannot +/// misroute a payload. A `mode` this crate does not know, or a payload that +/// does not fit the variant its `mode` selects, lands in `Unknown` with the +/// raw JSON intact. +/// +/// Deliberately has no `Default`: every arm's default would serialize to `{}`, +/// which carries no `mode` and so would not deserialize back to the same +/// variant. Build a [`ClickStackOnClickTarget`] instead when writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackOnClickTargetResponse { + ClickStackOnClickTargetIdVariant(ClickStackOnClickTargetIdVariantResponse), + ClickStackOnClickTargetTemplateVariant(ClickStackOnClickTargetTemplateVariantResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackOnClickTargetResponse, "mode" { + "id" => ClickStackOnClickTargetIdVariant, + "template" => ClickStackOnClickTargetTemplateVariant, + } +} + +impl std::fmt::Display for ClickStackOnClickTargetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackOnClickTargetIdVariant(_) => { + write!(f, "ClickStackOnClickTargetIdVariant") + } + Self::ClickStackOnClickTargetTemplateVariant(_) => { + write!(f, "ClickStackOnClickTargetTemplateVariant") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackPieChartConfig` - one of multiple variants. +/// +/// Dispatched on the `configType` field (absent or non-string dispatches to the +/// builder variant, unless the payload carries a raw-SQL-only key); see the +/// `discriminated_union!` invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackPieChartConfig { + ClickStackPieBuilderChartConfig(ClickStackPieBuilderChartConfig), + ClickStackPieRawSqlChartConfig(ClickStackPieRawSqlChartConfig), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackPieChartConfig, "configType" { + "sql" => ClickStackPieRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackPieBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackPieChartConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackPieBuilderChartConfig(_) => { + write!(f, "ClickStackPieBuilderChartConfig") + } + Self::ClickStackPieRawSqlChartConfig(_) => write!(f, "ClickStackPieRawSqlChartConfig"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackPieChartConfig` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackPieChartConfig`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `configType` field exactly as the request union is (absent +/// or non-string dispatches to the builder variant, unless the payload carries +/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each +/// variant's shape, so all-`Option` arms — which would match any object under +/// `untagged` matching — cannot misroute a payload, and the `unless` guard +/// keeps a raw-SQL payload with a dropped discriminator out of the total +/// builder arm. A payload that does not fit the variant its discriminator +/// selects lands in `Unknown` with the raw JSON intact. +/// +/// Deliberately has no `Default`: response values are produced by +/// deserialization, never constructed; build a [`ClickStackPieChartConfig`] instead when +/// writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackPieChartConfigResponse { + ClickStackPieRawSqlChartConfig(ClickStackPieRawSqlChartConfigResponse), + ClickStackPieBuilderChartConfig(ClickStackPieBuilderChartConfigResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackPieChartConfigResponse, "configType" { + "sql" => ClickStackPieRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackPieBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackPieChartConfigResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackPieRawSqlChartConfig(_) => write!(f, "ClickStackPieRawSqlChartConfig"), + Self::ClickStackPieBuilderChartConfig(_) => { + write!(f, "ClickStackPieBuilderChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackSource` - one of multiple variants. +/// +/// Dispatched on the `kind` field; see the `discriminated_union!` +/// invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackSource { + ClickStackLogSource(ClickStackLogSource), + ClickStackTraceSource(ClickStackTraceSource), + ClickStackMetricSource(ClickStackMetricSource), + ClickStackSessionSource(ClickStackSessionSource), + ClickStackPromqlSource(ClickStackPromqlSource), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackSource, "kind" { + "log" => ClickStackLogSource, + "trace" => ClickStackTraceSource, + "metric" => ClickStackMetricSource, + "session" => ClickStackSessionSource, + "promql" => ClickStackPromqlSource, + } +} + +impl std::fmt::Display for ClickStackSource { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackLogSource(_) => write!(f, "ClickStackLogSource"), + Self::ClickStackTraceSource(_) => write!(f, "ClickStackTraceSource"), + Self::ClickStackMetricSource(_) => write!(f, "ClickStackMetricSource"), + Self::ClickStackSessionSource(_) => write!(f, "ClickStackSessionSource"), + Self::ClickStackPromqlSource(_) => write!(f, "ClickStackPromqlSource"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackSource` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackSource`]: each arm is the all-`Option` +/// response variant of its request struct, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `kind` field, exactly as the request union is: dispatch +/// reads the raw JSON rather than trying each variant's shape, so all-`Option` +/// arms — which would match any object under `untagged` matching — cannot +/// misroute a payload. A `kind` this crate does not know, or a payload that does +/// not fit the variant its `kind` selects, lands in `Unknown` with the raw JSON +/// intact. +/// +/// Deliberately has no `Default`: every arm's default would serialize to `{}`, +/// which carries no `kind` and so would not deserialize back to the same +/// variant. Build a [`ClickStackSource`] instead when writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackSourceResponse { + ClickStackLogSource(ClickStackLogSourceResponse), + ClickStackTraceSource(ClickStackTraceSourceResponse), + ClickStackMetricSource(ClickStackMetricSourceResponse), + ClickStackSessionSource(ClickStackSessionSourceResponse), + ClickStackPromqlSource(ClickStackPromqlSourceResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackSourceResponse, "kind" { + "log" => ClickStackLogSource, + "trace" => ClickStackTraceSource, + "metric" => ClickStackMetricSource, + "session" => ClickStackSessionSource, + "promql" => ClickStackPromqlSource, + } +} + +impl std::fmt::Display for ClickStackSourceResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackLogSource(_) => write!(f, "ClickStackLogSource"), + Self::ClickStackTraceSource(_) => write!(f, "ClickStackTraceSource"), + Self::ClickStackMetricSource(_) => write!(f, "ClickStackMetricSource"), + Self::ClickStackSessionSource(_) => write!(f, "ClickStackSessionSource"), + Self::ClickStackPromqlSource(_) => write!(f, "ClickStackPromqlSource"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackTableChartConfig` - one of multiple variants. +/// +/// Dispatched on the `configType` field (absent or non-string dispatches to the +/// builder variant, unless the payload carries a raw-SQL-only key); see the +/// `discriminated_union!` invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackTableChartConfig { + ClickStackTableBuilderChartConfig(ClickStackTableBuilderChartConfig), + ClickStackTableRawSqlChartConfig(ClickStackTableRawSqlChartConfig), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackTableChartConfig, "configType" { + "sql" => ClickStackTableRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackTableBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackTableChartConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackTableBuilderChartConfig(_) => { + write!(f, "ClickStackTableBuilderChartConfig") + } + Self::ClickStackTableRawSqlChartConfig(_) => { + write!(f, "ClickStackTableRawSqlChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackTableChartConfig` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackTableChartConfig`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `configType` field exactly as the request union is (absent +/// or non-string dispatches to the builder variant, unless the payload carries +/// a raw-SQL-only key): dispatch reads the raw JSON rather than trying each +/// variant's shape, so all-`Option` arms — which would match any object under +/// `untagged` matching — cannot misroute a payload, and the `unless` guard +/// keeps a raw-SQL payload with a dropped discriminator out of the total +/// builder arm. A payload that does not fit the variant its discriminator +/// selects lands in `Unknown` with the raw JSON intact. +/// +/// Deliberately has no `Default`: response values are produced by +/// deserialization, never constructed; build a [`ClickStackTableChartConfig`] instead when +/// writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackTableChartConfigResponse { + ClickStackTableRawSqlChartConfig(ClickStackTableRawSqlChartConfigResponse), + ClickStackTableBuilderChartConfig(ClickStackTableBuilderChartConfigResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackTableChartConfigResponse, "configType" { + "sql" => ClickStackTableRawSqlChartConfig, + none unless "connectionId" | "sqlTemplate" => ClickStackTableBuilderChartConfig, + } +} + +impl std::fmt::Display for ClickStackTableChartConfigResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackTableRawSqlChartConfig(_) => { + write!(f, "ClickStackTableRawSqlChartConfig") + } + Self::ClickStackTableBuilderChartConfig(_) => { + write!(f, "ClickStackTableBuilderChartConfig") + } + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackTileConfig` - one of multiple variants. +/// +/// Dispatched on the `displayType` field; see the `discriminated_union!` +/// invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackTileConfig { + ClickStackCategoricalBarChartConfig(ClickStackCategoricalBarChartConfig), + ClickStackLineChartConfig(ClickStackLineChartConfig), + ClickStackBarChartConfig(ClickStackBarChartConfig), + ClickStackTableChartConfig(ClickStackTableChartConfig), + ClickStackNumberChartConfig(ClickStackNumberChartConfig), + ClickStackPieChartConfig(ClickStackPieChartConfig), + ClickStackHeatmapChartConfig(ClickStackHeatmapChartConfig), + ClickStackSearchChartConfig(ClickStackSearchChartConfig), + ClickStackEventPatternsChartConfig(ClickStackEventPatternsChartConfig), + ClickStackMarkdownChartConfig(ClickStackMarkdownChartConfig), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackTileConfig, "displayType" { + "line" => ClickStackLineChartConfig, + "stacked_bar" => ClickStackBarChartConfig, + "bar" => ClickStackCategoricalBarChartConfig, + "table" => ClickStackTableChartConfig, + "number" => ClickStackNumberChartConfig, + "pie" => ClickStackPieChartConfig, + "heatmap" => ClickStackHeatmapChartConfig, + "search" => ClickStackSearchChartConfig, + "event_patterns" => ClickStackEventPatternsChartConfig, + "markdown" => ClickStackMarkdownChartConfig, + } +} + +impl std::fmt::Display for ClickStackTileConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackCategoricalBarChartConfig(_) => { + write!(f, "ClickStackCategoricalBarChartConfig") + } + Self::ClickStackLineChartConfig(_) => write!(f, "ClickStackLineChartConfig"), + Self::ClickStackBarChartConfig(_) => write!(f, "ClickStackBarChartConfig"), + Self::ClickStackTableChartConfig(_) => write!(f, "ClickStackTableChartConfig"), + Self::ClickStackNumberChartConfig(_) => write!(f, "ClickStackNumberChartConfig"), + Self::ClickStackPieChartConfig(_) => write!(f, "ClickStackPieChartConfig"), + Self::ClickStackHeatmapChartConfig(_) => write!(f, "ClickStackHeatmapChartConfig"), + Self::ClickStackSearchChartConfig(_) => write!(f, "ClickStackSearchChartConfig"), + Self::ClickStackEventPatternsChartConfig(_) => { + write!(f, "ClickStackEventPatternsChartConfig") + } + Self::ClickStackMarkdownChartConfig(_) => write!(f, "ClickStackMarkdownChartConfig"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackTileConfig` - one of multiple variants, in response position. +/// +/// Response variant of [`ClickStackTileConfig`]: each arm is the all-`Option` +/// response variant of its request type, so a field the API drops or sends as +/// `null` deserializes to `None` instead of failing. +/// +/// Dispatched on the `displayType` field, exactly as the request union is: dispatch +/// reads the raw JSON rather than trying each variant's shape, so all-`Option` +/// arms — which would match any object under `untagged` matching — cannot +/// misroute a payload. A `displayType` this crate does not know, or a payload that +/// does not fit the variant its `displayType` selects, lands in `Unknown` with the +/// raw JSON intact. +/// +/// Deliberately has no `Default`: every arm's default would serialize to `{}`, +/// which carries no `displayType` and so would not deserialize back to the same +/// variant. Build a [`ClickStackTileConfig`] instead when writing. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackTileConfigResponse { + ClickStackLineChartConfig(ClickStackLineChartConfigResponse), + ClickStackBarChartConfig(ClickStackBarChartConfigResponse), + ClickStackCategoricalBarChartConfig(ClickStackCategoricalBarChartConfigResponse), + ClickStackTableChartConfig(ClickStackTableChartConfigResponse), + ClickStackNumberChartConfig(ClickStackNumberChartConfigResponse), + ClickStackPieChartConfig(ClickStackPieChartConfigResponse), + ClickStackHeatmapChartConfig(ClickStackHeatmapChartConfigResponse), + ClickStackSearchChartConfig(ClickStackSearchChartConfigResponse), + ClickStackEventPatternsChartConfig(ClickStackEventPatternsChartConfigResponse), + ClickStackMarkdownChartConfig(ClickStackMarkdownChartConfigResponse), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackTileConfigResponse, "displayType" { + "line" => ClickStackLineChartConfig, + "stacked_bar" => ClickStackBarChartConfig, + "bar" => ClickStackCategoricalBarChartConfig, + "table" => ClickStackTableChartConfig, + "number" => ClickStackNumberChartConfig, + "pie" => ClickStackPieChartConfig, + "heatmap" => ClickStackHeatmapChartConfig, + "search" => ClickStackSearchChartConfig, + "event_patterns" => ClickStackEventPatternsChartConfig, + "markdown" => ClickStackMarkdownChartConfig, + } +} + +impl std::fmt::Display for ClickStackTileConfigResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackLineChartConfig(_) => write!(f, "ClickStackLineChartConfig"), + Self::ClickStackBarChartConfig(_) => write!(f, "ClickStackBarChartConfig"), + Self::ClickStackCategoricalBarChartConfig(_) => { + write!(f, "ClickStackCategoricalBarChartConfig") + } + Self::ClickStackTableChartConfig(_) => write!(f, "ClickStackTableChartConfig"), + Self::ClickStackNumberChartConfig(_) => write!(f, "ClickStackNumberChartConfig"), + Self::ClickStackPieChartConfig(_) => write!(f, "ClickStackPieChartConfig"), + Self::ClickStackHeatmapChartConfig(_) => write!(f, "ClickStackHeatmapChartConfig"), + Self::ClickStackSearchChartConfig(_) => write!(f, "ClickStackSearchChartConfig"), + Self::ClickStackEventPatternsChartConfig(_) => { + write!(f, "ClickStackEventPatternsChartConfig") + } + Self::ClickStackMarkdownChartConfig(_) => write!(f, "ClickStackMarkdownChartConfig"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// `ClickStackWebhook` - one of multiple variants. +/// +/// Dispatched on the `service` field; see the `discriminated_union!` +/// invocation below for the wire values. +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum ClickStackWebhook { + ClickStackSlackWebhook(ClickStackSlackWebhook), + ClickStackIncidentIOWebhook(ClickStackIncidentIOWebhook), + ClickStackGenericWebhook(ClickStackGenericWebhook), + ClickStackSlackAPIWebhook(ClickStackSlackAPIWebhook), + ClickStackPagerDutyAPIWebhook(ClickStackPagerDutyAPIWebhook), + /// Catch-all for unknown or newly-added values. + /// + /// Holds the raw payload as `serde_json::Value` so it round-trips + /// losslessly; its `Display` emits the payload as compact JSON. + Unknown(serde_json::Value), +} + +discriminated_union! { + ClickStackWebhook, "service" { + "slack" => ClickStackSlackWebhook, + "incidentio" => ClickStackIncidentIOWebhook, + "generic" => ClickStackGenericWebhook, + "slack_api" => ClickStackSlackAPIWebhook, + "pagerduty_api" => ClickStackPagerDutyAPIWebhook, + } +} + +impl std::fmt::Display for ClickStackWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ClickStackSlackWebhook(_) => write!(f, "ClickStackSlackWebhook"), + Self::ClickStackIncidentIOWebhook(_) => write!(f, "ClickStackIncidentIOWebhook"), + Self::ClickStackGenericWebhook(_) => write!(f, "ClickStackGenericWebhook"), + Self::ClickStackSlackAPIWebhook(_) => write!(f, "ClickStackSlackAPIWebhook"), + Self::ClickStackPagerDutyAPIWebhook(_) => write!(f, "ClickStackPagerDutyAPIWebhook"), + Self::Unknown(s) => write!(f, "{s}"), + } + } +} + +/// Type alias for `ClickStackCASLPermissionConditions`. +pub type ClickStackCASLPermissionConditions = serde_json::Value; + +/// Type alias for `ClickStackValidateDashboardResponseNormalized`. +pub type ClickStackValidateDashboardResponseNormalized = serde_json::Value; + +/// Type alias for `ClickStackWebhookInputHeaders`. +pub type ClickStackWebhookInputHeaders = std::collections::BTreeMap; + +/// Type alias for `ClickStackWebhookInputQueryParams`. +pub type ClickStackWebhookInputQueryParams = std::collections::BTreeMap; + +/// `ClickStackAggregatedColumn` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAggregatedColumn { + #[serde(rename = "aggFn")] + pub agg_fn: String, + #[serde(rename = "mvColumn")] + pub mv_column: String, + #[serde(rename = "sourceColumn", skip_serializing_if = "Option::is_none")] + pub source_column: Option, +} + +/// `ClickStackAggregatedColumn` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackAggregatedColumn`]: every field is +/// `Option`, so a field the API drops or sends as `null` deserializes to +/// `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAggregatedColumnResponse { + #[serde(rename = "aggFn", skip_serializing_if = "Option::is_none")] + pub agg_fn: Option, + #[serde(rename = "mvColumn", skip_serializing_if = "Option::is_none")] + pub mv_column: Option, + #[serde(rename = "sourceColumn", skip_serializing_if = "Option::is_none")] + pub source_column: Option, +} + +/// `ClickStackAlertChannelEmail` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAlertChannelEmail { + #[serde(rename = "emailRecipients")] + pub email_recipients: Vec, + pub r#type: ClickStackAlertChannelEmailType, +} + +/// `ClickStackAlertChannelEmail` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackAlertChannelEmail`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAlertChannelEmailResponse { + #[serde(rename = "emailRecipients", skip_serializing_if = "Option::is_none")] + pub email_recipients: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +/// `ClickStackAlertChannelWebhook` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAlertChannelWebhook { + #[serde(skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[serde(rename = "slackChannelId", skip_serializing_if = "Option::is_none")] + pub slack_channel_id: Option, + pub r#type: ClickStackAlertChannelWebhookType, + #[serde(rename = "webhookId")] + pub webhook_id: String, + #[serde(rename = "webhookService", skip_serializing_if = "Option::is_none")] + pub webhook_service: Option, +} + +/// `ClickStackAlertChannelWebhook` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackAlertChannelWebhook`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAlertChannelWebhookResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[serde(rename = "slackChannelId", skip_serializing_if = "Option::is_none")] + pub slack_channel_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "webhookId", skip_serializing_if = "Option::is_none")] + pub webhook_id: Option, + #[serde(rename = "webhookService", skip_serializing_if = "Option::is_none")] + pub webhook_service: Option, +} + +/// `ClickStackAlertExecutionError` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAlertExecutionError { + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub timestamp: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +/// `ClickStackAlertResponse` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAlertResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub channel: Option, + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(rename = "dashboardId", skip_serializing_if = "Option::is_none")] + pub dashboard_id: Option, + #[serde(rename = "executionErrors", skip_serializing_if = "Option::is_none")] + pub execution_errors: Option>, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub note: Option, + #[serde( + rename = "numConsecutiveWindows", + skip_serializing_if = "Option::is_none" + )] + pub num_consecutive_windows: Option, + #[serde(rename = "savedSearchId", skip_serializing_if = "Option::is_none")] + pub saved_search_id: Option, + #[serde( + rename = "scheduleOffsetMinutes", + skip_serializing_if = "Option::is_none" + )] + pub schedule_offset_minutes: Option, + #[serde(rename = "scheduleStartAt", skip_serializing_if = "Option::is_none")] + pub schedule_start_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub silenced: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "teamId", skip_serializing_if = "Option::is_none")] + pub team_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold: Option, + #[serde(rename = "thresholdMax", skip_serializing_if = "Option::is_none")] + pub threshold_max: Option, + #[serde(rename = "thresholdType", skip_serializing_if = "Option::is_none")] + pub threshold_type: Option, + #[serde(rename = "tileId", skip_serializing_if = "Option::is_none")] + pub tile_id: Option, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, +} + +/// `ClickStackAlertSilenced` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackAlertSilenced { + #[serde(skip_serializing_if = "Option::is_none")] + pub at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub until: Option>, +} + +/// `ClickStackBackgroundChart` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackBackgroundChart { + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + pub r#type: ClickStackBackgroundChartType, +} + +/// `ClickStackBackgroundChart` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackBackgroundChart`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackBackgroundChartResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +/// `ClickStackBarBuilderChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackBarBuilderChartConfig { + #[serde( + rename = "alignDateRangeToGranularity", + skip_serializing_if = "Option::is_none" + )] + pub align_date_range_to_granularity: Option, + #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] + pub as_ratio: Option, + #[serde(rename = "displayType")] + pub display_type: ClickStackBarBuilderChartConfigDisplaytype, + #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] + pub fill_nulls: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + pub select: Vec, + #[serde(rename = "sourceId")] + pub source_id: String, +} + +/// `ClickStackBarBuilderChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackBarBuilderChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackBarBuilderChartConfigResponse { + #[serde( + rename = "alignDateRangeToGranularity", + skip_serializing_if = "Option::is_none" + )] + pub align_date_range_to_granularity: Option, + #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] + pub as_ratio: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] + pub fill_nulls: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option>, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, +} + +/// `ClickStackBarRawSqlChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackBarRawSqlChartConfig { + #[serde( + rename = "alignDateRangeToGranularity", + skip_serializing_if = "Option::is_none" + )] + pub align_date_range_to_granularity: Option, + #[serde(rename = "configType")] + pub config_type: ClickStackBarRawSqlChartConfigConfigtype, + #[serde(rename = "connectionId")] + pub connection_id: String, + #[serde(rename = "displayType")] + pub display_type: ClickStackBarRawSqlChartConfigDisplaytype, + #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] + pub fill_nulls: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate")] + pub sql_template: String, +} + +/// `ClickStackBarRawSqlChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackBarRawSqlChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackBarRawSqlChartConfigResponse { + #[serde( + rename = "alignDateRangeToGranularity", + skip_serializing_if = "Option::is_none" + )] + pub align_date_range_to_granularity: Option, + #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] + pub config_type: Option, + #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] + pub connection_id: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] + pub fill_nulls: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] + pub sql_template: Option, +} + +/// `ClickStackBetweenColorCondition` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackBetweenColorCondition { + pub color: ClickStackChartColor, + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + pub operator: ClickStackBetweenColorConditionOperator, + pub value: Vec, +} + +/// `ClickStackBetweenColorCondition` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackBetweenColorCondition`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackBetweenColorConditionResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub operator: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option>, +} + +/// `ClickStackCASLPermission` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCASLPermission { + pub action: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub conditions: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub integration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub inverted: Option, + pub subject: String, +} + +/// `ClickStackCASLPermission` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackCASLPermission`]: every field is +/// `Option`, so a field the API drops or sends as `null` deserializes to +/// `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCASLPermissionResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub action: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub conditions: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub integration: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub inverted: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub subject: Option, +} + +/// `ClickStackCategoricalBarBuilderChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCategoricalBarBuilderChartConfig { + #[serde(rename = "displayType")] + pub display_type: ClickStackCategoricalBarBuilderChartConfigDisplaytype, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] + pub order_by: Option, + pub select: Vec, + #[serde(rename = "sourceId")] + pub source_id: String, +} + +/// `ClickStackCategoricalBarBuilderChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackCategoricalBarBuilderChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCategoricalBarBuilderChartConfigResponse { + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] + pub order_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option>, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, +} + +/// `ClickStackCategoricalBarRawSqlChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCategoricalBarRawSqlChartConfig { + #[serde(rename = "configType")] + pub config_type: ClickStackCategoricalBarRawSqlChartConfigConfigtype, + #[serde(rename = "connectionId")] + pub connection_id: String, + #[serde(rename = "displayType")] + pub display_type: ClickStackCategoricalBarRawSqlChartConfigDisplaytype, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate")] + pub sql_template: String, +} + +/// `ClickStackCategoricalBarRawSqlChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackCategoricalBarRawSqlChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCategoricalBarRawSqlChartConfigResponse { + #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] + pub config_type: Option, + #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] + pub connection_id: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] + pub sql_template: Option, +} + +/// `ClickStackConnection` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackConnection { + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub host: Option, + #[serde( + rename = "hyperdxSettingPrefix", + skip_serializing_if = "Option::is_none" + )] + pub hyperdx_setting_prefix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde( + rename = "isPrometheusEndpoint", + skip_serializing_if = "Option::is_none" + )] + pub is_prometheus_endpoint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub username: Option, +} + +/// `ClickStackCreateAlertRequest` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCreateAlertRequest { + pub channel: ClickStackAlertChannel, + #[serde(rename = "dashboardId", skip_serializing_if = "Option::is_none")] + pub dashboard_id: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + pub interval: ClickStackCreateAlertRequestInterval, + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub note: Option, + #[serde( + rename = "numConsecutiveWindows", + skip_serializing_if = "Option::is_none" + )] + pub num_consecutive_windows: Option, + #[serde(rename = "savedSearchId", skip_serializing_if = "Option::is_none")] + pub saved_search_id: Option, + #[serde( + rename = "scheduleOffsetMinutes", + skip_serializing_if = "Option::is_none" + )] + pub schedule_offset_minutes: Option, + #[serde(rename = "scheduleStartAt", skip_serializing_if = "Option::is_none")] + pub schedule_start_at: Option>, + pub source: ClickStackCreateAlertRequestSource, + pub threshold: f64, + #[serde(rename = "thresholdMax", skip_serializing_if = "Option::is_none")] + pub threshold_max: Option, + #[serde(rename = "thresholdType")] + pub threshold_type: ClickStackCreateAlertRequestThresholdtype, + #[serde(rename = "tileId", skip_serializing_if = "Option::is_none")] + pub tile_id: Option, +} + +/// `ClickStackCreateConnectionRequest` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCreateConnectionRequest { + pub host: String, + #[serde( + rename = "hyperdxSettingPrefix", + skip_serializing_if = "Option::is_none" + )] + pub hyperdx_setting_prefix: Option, + #[serde( + rename = "isPrometheusEndpoint", + skip_serializing_if = "Option::is_none" + )] + pub is_prometheus_endpoint: Option, + pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub password: Option, + pub username: String, +} + +/// `ClickStackCreateDashboardRequest` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCreateDashboardRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub containers: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + pub name: String, + #[serde(rename = "savedFilterValues", skip_serializing_if = "Option::is_none")] + pub saved_filter_values: Option>, + #[serde(rename = "savedQuery", skip_serializing_if = "Option::is_none")] + pub saved_query: Option, + #[serde(rename = "savedQueryLanguage", skip_serializing_if = "Option::is_none")] + pub saved_query_language: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + pub tiles: Vec, +} + +/// `ClickStackCreateRoleRequest` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackCreateRoleRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + pub name: String, + pub permissions: Vec, +} + +/// `ClickStackDashboardContainer` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackDashboardContainer { + #[serde(skip_serializing_if = "Option::is_none")] + pub bordered: Option, + pub collapsed: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub collapsible: Option, + pub id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub tabs: Option>, + pub title: String, +} + +/// `ClickStackDashboardContainer` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackDashboardContainer`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackDashboardContainerResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub bordered: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub collapsed: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub collapsible: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tabs: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +/// `ClickStackDashboardContainerTab` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackDashboardContainerTab { + pub id: String, + pub title: String, +} + +/// `ClickStackDashboardContainerTab` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackDashboardContainerTab`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackDashboardContainerTabResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +/// `ClickStackDashboardResponse` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackDashboardResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub containers: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "savedFilterValues", skip_serializing_if = "Option::is_none")] + pub saved_filter_values: Option>, + #[serde(rename = "savedQuery", skip_serializing_if = "Option::is_none")] + pub saved_query: Option, + #[serde(rename = "savedQueryLanguage", skip_serializing_if = "Option::is_none")] + pub saved_query_language: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub tiles: Option>, +} + +/// `ClickStackEqualityColorCondition` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackEqualityColorCondition { + pub color: ClickStackChartColor, + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + pub operator: ClickStackEqualityColorConditionOperator, + /// A finite number or a string; the spec models this as `oneOf number|string`. + pub value: serde_json::Value, +} + +/// `ClickStackEqualityColorCondition` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackEqualityColorCondition`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackEqualityColorConditionResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub operator: Option, + /// A finite number or a string; the spec models this as `oneOf number|string`. + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +/// `ClickStackEventPatternsChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackEventPatternsChartConfig { + #[serde(rename = "displayType")] + pub display_type: ClickStackEventPatternsChartConfigDisplaytype, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option, + #[serde(rename = "sourceId")] + pub source_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackEventPatternsChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackEventPatternsChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackEventPatternsChartConfigResponse { + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackFilter` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackFilter { + #[serde(rename = "appliesToSourceIds", skip_serializing_if = "Option::is_none")] + pub applies_to_source_ids: Option>, + pub expression: String, + pub id: String, + pub name: String, + #[serde(rename = "sourceId")] + pub source_id: String, + #[serde(rename = "sourceMetricType", skip_serializing_if = "Option::is_none")] + pub source_metric_type: Option, + pub r#type: ClickStackFilterType, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackFilter` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackFilter`]: every field is `Option`, so a +/// field the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackFilterResponse { + #[serde(rename = "appliesToSourceIds", skip_serializing_if = "Option::is_none")] + pub applies_to_source_ids: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sourceMetricType", skip_serializing_if = "Option::is_none")] + pub source_metric_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackFilterInput` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackFilterInput { + #[serde(rename = "appliesToSourceIds", skip_serializing_if = "Option::is_none")] + pub applies_to_source_ids: Option>, + pub expression: String, + pub name: String, + #[serde(rename = "sourceId")] + pub source_id: String, + #[serde(rename = "sourceMetricType", skip_serializing_if = "Option::is_none")] + pub source_metric_type: Option, + pub r#type: ClickStackFilterInputType, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackFilterSettingsColumn` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackFilterSettingsColumn { + pub label: String, + pub name: String, +} + +/// `ClickStackFilterSettingsColumn` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackFilterSettingsColumn`]: every field is +/// `Option`, so a field the API drops or sends as `null` deserializes to +/// `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackFilterSettingsColumnResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +/// `ClickStackGenericWebhook` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackGenericWebhook { + #[serde(skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub service: Option, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +/// `ClickStackHeatmapChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackHeatmapChartConfig { + #[serde(rename = "displayType")] + pub display_type: ClickStackHeatmapChartConfigDisplaytype, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + pub select: Vec, + #[serde(rename = "sourceId")] + pub source_id: String, + #[serde(rename = "where", skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackHeatmapChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackHeatmapChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackHeatmapChartConfigResponse { + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option>, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "where", skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackHeatmapSelectItem` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackHeatmapSelectItem { + #[serde(rename = "countExpression", skip_serializing_if = "Option::is_none")] + pub count_expression: Option, + #[serde(rename = "heatmapScaleType", skip_serializing_if = "Option::is_none")] + pub heatmap_scale_type: Option, + #[serde(rename = "valueExpression")] + pub value_expression: String, +} + +/// `ClickStackHeatmapSelectItem` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackHeatmapSelectItem`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackHeatmapSelectItemResponse { + #[serde(rename = "countExpression", skip_serializing_if = "Option::is_none")] + pub count_expression: Option, + #[serde(rename = "heatmapScaleType", skip_serializing_if = "Option::is_none")] + pub heatmap_scale_type: Option, + #[serde(rename = "valueExpression", skip_serializing_if = "Option::is_none")] + pub value_expression: Option, +} + +/// `ClickStackHighlightedAttributeExpression` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackHighlightedAttributeExpression { + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option, + #[serde(rename = "luceneExpression", skip_serializing_if = "Option::is_none")] + pub lucene_expression: Option, + #[serde(rename = "sqlExpression")] + pub sql_expression: String, +} + +/// `ClickStackHighlightedAttributeExpression` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackHighlightedAttributeExpression`]: every +/// field is `Option`, so a field the API drops or sends as `null` +/// deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackHighlightedAttributeExpressionResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option, + #[serde(rename = "luceneExpression", skip_serializing_if = "Option::is_none")] + pub lucene_expression: Option, + #[serde(rename = "sqlExpression", skip_serializing_if = "Option::is_none")] + pub sql_expression: Option, +} + +/// `ClickStackIncidentIOWebhook` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackIncidentIOWebhook { + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub service: Option, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +/// `ClickStackLineBuilderChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackLineBuilderChartConfig { + #[serde( + rename = "alignDateRangeToGranularity", + skip_serializing_if = "Option::is_none" + )] + pub align_date_range_to_granularity: Option, + #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] + pub as_ratio: Option, + #[serde( + rename = "compareToPreviousPeriod", + skip_serializing_if = "Option::is_none" + )] + pub compare_to_previous_period: Option, + #[serde(rename = "displayType")] + pub display_type: ClickStackLineBuilderChartConfigDisplaytype, + #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] + pub fill_nulls: Option, + #[serde(rename = "fitYAxisToData", skip_serializing_if = "Option::is_none")] + pub fit_y_axis_to_data: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + pub select: Vec, + #[serde(rename = "sourceId")] + pub source_id: String, +} + +/// `ClickStackLineBuilderChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackLineBuilderChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackLineBuilderChartConfigResponse { + #[serde( + rename = "alignDateRangeToGranularity", + skip_serializing_if = "Option::is_none" + )] + pub align_date_range_to_granularity: Option, + #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] + pub as_ratio: Option, + #[serde( + rename = "compareToPreviousPeriod", + skip_serializing_if = "Option::is_none" + )] + pub compare_to_previous_period: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] + pub fill_nulls: Option, + #[serde(rename = "fitYAxisToData", skip_serializing_if = "Option::is_none")] + pub fit_y_axis_to_data: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option>, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, +} + +/// `ClickStackLineRawSqlChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackLineRawSqlChartConfig { + #[serde( + rename = "alignDateRangeToGranularity", + skip_serializing_if = "Option::is_none" + )] + pub align_date_range_to_granularity: Option, + #[serde( + rename = "compareToPreviousPeriod", + skip_serializing_if = "Option::is_none" + )] + pub compare_to_previous_period: Option, + #[serde(rename = "configType")] + pub config_type: ClickStackLineRawSqlChartConfigConfigtype, + #[serde(rename = "connectionId")] + pub connection_id: String, + #[serde(rename = "displayType")] + pub display_type: ClickStackLineRawSqlChartConfigDisplaytype, + #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] + pub fill_nulls: Option, + #[serde(rename = "fitYAxisToData", skip_serializing_if = "Option::is_none")] + pub fit_y_axis_to_data: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate")] + pub sql_template: String, +} + +/// `ClickStackLineRawSqlChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackLineRawSqlChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackLineRawSqlChartConfigResponse { + #[serde( + rename = "alignDateRangeToGranularity", + skip_serializing_if = "Option::is_none" + )] + pub align_date_range_to_granularity: Option, + #[serde( + rename = "compareToPreviousPeriod", + skip_serializing_if = "Option::is_none" + )] + pub compare_to_previous_period: Option, + #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] + pub config_type: Option, + #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] + pub connection_id: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "fillNulls", skip_serializing_if = "Option::is_none")] + pub fill_nulls: Option, + #[serde(rename = "fitYAxisToData", skip_serializing_if = "Option::is_none")] + pub fit_y_axis_to_data: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] + pub sql_template: Option, +} + +/// `ClickStackLogSource` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackLogSource { + #[serde(rename = "bodyExpression", skip_serializing_if = "Option::is_none")] + pub body_expression: Option, + pub connection: String, + #[serde(rename = "defaultTableSelectExpression")] + pub default_table_select_expression: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde( + rename = "displayedTimestampValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub displayed_timestamp_value_expression: Option, + #[serde( + rename = "eventAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub event_attributes_expression: Option, + #[serde(rename = "filterSettings", skip_serializing_if = "Option::is_none")] + pub filter_settings: Option, + pub from: ClickStackSourceFrom, + #[serde( + rename = "highlightedRowAttributeExpressions", + skip_serializing_if = "Option::is_none" + )] + pub highlighted_row_attribute_expressions: + Option>, + #[serde( + rename = "highlightedTraceAttributeExpressions", + skip_serializing_if = "Option::is_none" + )] + pub highlighted_trace_attribute_expressions: + Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde( + rename = "implicitColumnExpression", + skip_serializing_if = "Option::is_none" + )] + pub implicit_column_expression: Option, + pub kind: ClickStackLogSourceKind, + #[serde( + rename = "knownColumnsListExpression", + skip_serializing_if = "Option::is_none" + )] + pub known_columns_list_expression: Option, + #[serde(rename = "materializedViews", skip_serializing_if = "Option::is_none")] + pub materialized_views: Option>, + #[serde( + rename = "metadataMaterializedViews", + skip_serializing_if = "Option::is_none" + )] + pub metadata_materialized_views: Option, + #[serde(rename = "metricSourceId", skip_serializing_if = "Option::is_none")] + pub metric_source_id: Option, + pub name: String, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde( + rename = "resourceAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub resource_attributes_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde( + rename = "serviceNameExpression", + skip_serializing_if = "Option::is_none" + )] + pub service_name_expression: Option, + #[serde( + rename = "severityTextExpression", + skip_serializing_if = "Option::is_none" + )] + pub severity_text_expression: Option, + #[serde(rename = "spanIdExpression", skip_serializing_if = "Option::is_none")] + pub span_id_expression: Option, + #[serde(rename = "timestampValueExpression")] + pub timestamp_value_expression: String, + #[serde(rename = "traceIdExpression", skip_serializing_if = "Option::is_none")] + pub trace_id_expression: Option, + #[serde(rename = "traceSourceId", skip_serializing_if = "Option::is_none")] + pub trace_source_id: Option, + #[serde( + rename = "useTextIndexForImplicitColumn", + skip_serializing_if = "Option::is_none" + )] + pub use_text_index_for_implicit_column: + Option, +} + +/// `ClickStackLogSource` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackLogSource`]: every field is `Option`, so +/// a field the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackLogSourceResponse { + #[serde(rename = "bodyExpression", skip_serializing_if = "Option::is_none")] + pub body_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub connection: Option, + #[serde( + rename = "defaultTableSelectExpression", + skip_serializing_if = "Option::is_none" + )] + pub default_table_select_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde( + rename = "displayedTimestampValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub displayed_timestamp_value_expression: Option, + #[serde( + rename = "eventAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub event_attributes_expression: Option, + #[serde(rename = "filterSettings", skip_serializing_if = "Option::is_none")] + pub filter_settings: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub from: Option, + #[serde( + rename = "highlightedRowAttributeExpressions", + skip_serializing_if = "Option::is_none" + )] + pub highlighted_row_attribute_expressions: + Option>, + #[serde( + rename = "highlightedTraceAttributeExpressions", + skip_serializing_if = "Option::is_none" + )] + pub highlighted_trace_attribute_expressions: + Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde( + rename = "implicitColumnExpression", + skip_serializing_if = "Option::is_none" + )] + pub implicit_column_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde( + rename = "knownColumnsListExpression", + skip_serializing_if = "Option::is_none" + )] + pub known_columns_list_expression: Option, + #[serde(rename = "materializedViews", skip_serializing_if = "Option::is_none")] + pub materialized_views: Option>, + #[serde( + rename = "metadataMaterializedViews", + skip_serializing_if = "Option::is_none" + )] + pub metadata_materialized_views: Option, + #[serde(rename = "metricSourceId", skip_serializing_if = "Option::is_none")] + pub metric_source_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde( + rename = "resourceAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub resource_attributes_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde( + rename = "serviceNameExpression", + skip_serializing_if = "Option::is_none" + )] + pub service_name_expression: Option, + #[serde( + rename = "severityTextExpression", + skip_serializing_if = "Option::is_none" + )] + pub severity_text_expression: Option, + #[serde(rename = "spanIdExpression", skip_serializing_if = "Option::is_none")] + pub span_id_expression: Option, + #[serde( + rename = "timestampValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub timestamp_value_expression: Option, + #[serde(rename = "traceIdExpression", skip_serializing_if = "Option::is_none")] + pub trace_id_expression: Option, + #[serde(rename = "traceSourceId", skip_serializing_if = "Option::is_none")] + pub trace_source_id: Option, + #[serde( + rename = "useTextIndexForImplicitColumn", + skip_serializing_if = "Option::is_none" + )] + pub use_text_index_for_implicit_column: + Option, +} + +/// `ClickStackLogSourceMetadataMaterializedViews` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackLogSourceMetadataMaterializedViews { + pub granularity: String, + #[serde(rename = "keyRollupTable")] + pub key_rollup_table: String, + #[serde(rename = "kvRollupTable")] + pub kv_rollup_table: String, +} + +/// `ClickStackLogSourceMetadataMaterializedViews` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackLogSourceMetadataMaterializedViews`]: every +/// field is `Option`, so a field the API drops or sends as `null` +/// deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackLogSourceMetadataMaterializedViewsResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub granularity: Option, + #[serde(rename = "keyRollupTable", skip_serializing_if = "Option::is_none")] + pub key_rollup_table: Option, + #[serde(rename = "kvRollupTable", skip_serializing_if = "Option::is_none")] + pub kv_rollup_table: Option, +} + +/// `ClickStackMarkdownChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMarkdownChartConfig { + #[serde(rename = "displayType")] + pub display_type: ClickStackMarkdownChartConfigDisplaytype, + #[serde(skip_serializing_if = "Option::is_none")] + pub markdown: Option, +} + +/// `ClickStackMarkdownChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackMarkdownChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMarkdownChartConfigResponse { + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub markdown: Option, +} + +/// `ClickStackMarkdownChartSeries` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMarkdownChartSeries { + pub content: String, + pub r#type: ClickStackMarkdownChartSeriesType, +} + +/// `ClickStackMaterializedView` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMaterializedView { + #[serde(rename = "aggregatedColumns")] + pub aggregated_columns: Vec, + #[serde(rename = "databaseName")] + pub database_name: String, + #[serde(rename = "dimensionColumns")] + pub dimension_columns: String, + #[serde(rename = "minDate", skip_serializing_if = "Option::is_none")] + pub min_date: Option>, + #[serde(rename = "minGranularity")] + pub min_granularity: ClickStackMaterializedViewMingranularity, + #[serde(rename = "tableName")] + pub table_name: String, + #[serde(rename = "timestampColumn")] + pub timestamp_column: String, +} + +/// `ClickStackMaterializedView` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackMaterializedView`]: every field is +/// `Option`, so a field the API drops or sends as `null` deserializes to +/// `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMaterializedViewResponse { + #[serde(rename = "aggregatedColumns", skip_serializing_if = "Option::is_none")] + pub aggregated_columns: Option>, + #[serde(rename = "databaseName", skip_serializing_if = "Option::is_none")] + pub database_name: Option, + #[serde(rename = "dimensionColumns", skip_serializing_if = "Option::is_none")] + pub dimension_columns: Option, + #[serde(rename = "minDate", skip_serializing_if = "Option::is_none")] + pub min_date: Option>, + #[serde(rename = "minGranularity", skip_serializing_if = "Option::is_none")] + pub min_granularity: Option, + #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] + pub table_name: Option, + #[serde(rename = "timestampColumn", skip_serializing_if = "Option::is_none")] + pub timestamp_column: Option, +} + +/// `ClickStackMetricSource` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMetricSource { + pub connection: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + pub from: ClickStackMetricSourceFrom, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + pub kind: ClickStackMetricSourceKind, + #[serde(rename = "logSourceId", skip_serializing_if = "Option::is_none")] + pub log_source_id: Option, + #[serde(rename = "metricTables")] + pub metric_tables: ClickStackMetricTables, + pub name: String, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde(rename = "resourceAttributesExpression")] + pub resource_attributes_expression: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde(rename = "timestampValueExpression")] + pub timestamp_value_expression: String, +} + +/// `ClickStackMetricSource` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackMetricSource`]: every field is `Option`, +/// so a field the API drops or sends as `null` deserializes to `None` instead +/// of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMetricSourceResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub connection: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub from: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde(rename = "logSourceId", skip_serializing_if = "Option::is_none")] + pub log_source_id: Option, + #[serde(rename = "metricTables", skip_serializing_if = "Option::is_none")] + pub metric_tables: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde( + rename = "resourceAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub resource_attributes_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde( + rename = "timestampValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub timestamp_value_expression: Option, +} + +/// `ClickStackMetricSourceFrom` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMetricSourceFrom { + #[serde(rename = "databaseName")] + pub database_name: String, + #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] + pub table_name: Option, +} + +/// `ClickStackMetricSourceFrom` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackMetricSourceFrom`]: every field is +/// `Option`, so a field the API drops or sends as `null` deserializes to +/// `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMetricSourceFromResponse { + #[serde(rename = "databaseName", skip_serializing_if = "Option::is_none")] + pub database_name: Option, + #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] + pub table_name: Option, +} + +/// `ClickStackMetricTables` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMetricTables { + #[serde(rename = "exponential histogram")] + pub exponential_histogram: String, + pub gauge: String, + pub histogram: String, + pub sum: String, + pub summary: String, +} + +/// `ClickStackMetricTables` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackMetricTables`]: every field is `Option`, +/// so a field the API drops or sends as `null` deserializes to `None` instead +/// of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackMetricTablesResponse { + #[serde( + rename = "exponential histogram", + skip_serializing_if = "Option::is_none" + )] + pub exponential_histogram: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub gauge: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub histogram: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sum: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option, +} + +/// `ClickStackNumberBuilderChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumberBuilderChartConfig { + #[serde(rename = "backgroundChart", skip_serializing_if = "Option::is_none")] + pub background_chart: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(rename = "colorRules", skip_serializing_if = "Option::is_none")] + pub color_rules: Option>, + #[serde(rename = "displayType")] + pub display_type: ClickStackNumberBuilderChartConfigDisplaytype, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + pub select: Vec, + #[serde(rename = "sourceId")] + pub source_id: String, +} + +/// `ClickStackNumberBuilderChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackNumberBuilderChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumberBuilderChartConfigResponse { + #[serde(rename = "backgroundChart", skip_serializing_if = "Option::is_none")] + pub background_chart: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(rename = "colorRules", skip_serializing_if = "Option::is_none")] + pub color_rules: Option>, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option>, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, +} + +/// `ClickStackNumberChartSeries` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumberChartSeries { + #[serde(rename = "aggFn")] + pub agg_fn: ClickStackNumberChartSeriesAggfn, + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub field: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub level: Option, + #[serde(rename = "metricDataType", skip_serializing_if = "Option::is_none")] + pub metric_data_type: Option, + #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] + pub metric_name: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId")] + pub source_id: String, + pub r#type: ClickStackNumberChartSeriesType, + pub r#where: String, + #[serde(rename = "whereLanguage")] + pub where_language: ClickStackNumberChartSeriesWherelanguage, +} + +/// `ClickStackNumberFormat` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumberFormat { + pub average: bool, + #[serde(rename = "currencySymbol")] + pub currency_symbol: String, + #[serde(rename = "decimalBytes")] + pub decimal_bytes: bool, + pub factor: f64, + pub mantissa: i64, + #[serde(rename = "numericUnit")] + pub numeric_unit: ClickStackNumberFormatNumericunit, + pub output: ClickStackNumberFormatOutput, + #[serde(rename = "thousandSeparated")] + pub thousand_separated: bool, + pub unit: String, +} + +/// `ClickStackNumberFormat` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackNumberFormat`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumberFormatResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub average: Option, + #[serde(rename = "currencySymbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "decimalBytes", skip_serializing_if = "Option::is_none")] + pub decimal_bytes: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub factor: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mantissa: Option, + #[serde(rename = "numericUnit", skip_serializing_if = "Option::is_none")] + pub numeric_unit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub output: Option, + #[serde(rename = "thousandSeparated", skip_serializing_if = "Option::is_none")] + pub thousand_separated: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub unit: Option, +} + +/// `ClickStackNumberRawSqlChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumberRawSqlChartConfig { + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(rename = "configType")] + pub config_type: ClickStackNumberRawSqlChartConfigConfigtype, + #[serde(rename = "connectionId")] + pub connection_id: String, + #[serde(rename = "displayType")] + pub display_type: ClickStackNumberRawSqlChartConfigDisplaytype, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate")] + pub sql_template: String, +} + +/// `ClickStackNumberRawSqlChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackNumberRawSqlChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumberRawSqlChartConfigResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] + pub config_type: Option, + #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] + pub connection_id: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] + pub sql_template: Option, +} + +/// `ClickStackNumericColorCondition` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumericColorCondition { + pub color: ClickStackChartColor, + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + pub operator: ClickStackNumericColorConditionOperator, + pub value: f64, +} + +/// `ClickStackNumericColorCondition` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackNumericColorCondition`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackNumericColorConditionResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub operator: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +/// `ClickStackOnClickDashboard` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickDashboard { + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + pub target: ClickStackOnClickTarget, + pub r#type: ClickStackOnClickDashboardType, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, + #[serde(rename = "whereTemplate", skip_serializing_if = "Option::is_none")] + pub where_template: Option, +} + +/// `ClickStackOnClickDashboard` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackOnClickDashboard`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickDashboardResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub target: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, + #[serde(rename = "whereTemplate", skip_serializing_if = "Option::is_none")] + pub where_template: Option, +} + +/// `ClickStackOnClickExternal` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickExternal { + pub r#type: ClickStackOnClickExternalType, + #[serde(rename = "urlTemplate")] + pub url_template: String, +} + +/// `ClickStackOnClickExternal` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackOnClickExternal`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickExternalResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "urlTemplate", skip_serializing_if = "Option::is_none")] + pub url_template: Option, +} + +/// `ClickStackOnClickFilterTemplate` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickFilterTemplate { + pub expression: String, + pub kind: ClickStackOnClickFilterTemplateKind, + pub template: String, +} + +/// `ClickStackOnClickFilterTemplate` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackOnClickFilterTemplate`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickFilterTemplateResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +/// `ClickStackOnClickSearch` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickSearch { + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + pub target: ClickStackOnClickTarget, + pub r#type: ClickStackOnClickSearchType, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, + #[serde(rename = "whereTemplate", skip_serializing_if = "Option::is_none")] + pub where_template: Option, +} + +/// `ClickStackOnClickSearch` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackOnClickSearch`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickSearchResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub target: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, + #[serde(rename = "whereTemplate", skip_serializing_if = "Option::is_none")] + pub where_template: Option, +} + +/// `ClickStackOnClickTargetIdVariant` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickTargetIdVariant { + pub id: String, + pub mode: ClickStackOnClickTargetIdVariantMode, +} + +/// `ClickStackOnClickTargetIdVariant` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackOnClickTargetIdVariant`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickTargetIdVariantResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, +} + +/// `ClickStackOnClickTargetTemplateVariant` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickTargetTemplateVariant { + pub mode: ClickStackOnClickTargetTemplateVariantMode, + pub template: String, +} + +/// `ClickStackOnClickTargetTemplateVariant` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackOnClickTargetTemplateVariant`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackOnClickTargetTemplateVariantResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +/// `ClickStackPagerDutyAPIWebhook` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackPagerDutyAPIWebhook { + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub service: Option, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +/// `ClickStackPieBuilderChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackPieBuilderChartConfig { + #[serde(rename = "displayType")] + pub display_type: ClickStackPieBuilderChartConfigDisplaytype, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] + pub order_by: Option, + pub select: Vec, + #[serde(rename = "sourceId")] + pub source_id: String, +} + +/// `ClickStackPieBuilderChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackPieBuilderChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackPieBuilderChartConfigResponse { + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] + pub order_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option>, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, +} + +/// `ClickStackPieRawSqlChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackPieRawSqlChartConfig { + #[serde(rename = "configType")] + pub config_type: ClickStackPieRawSqlChartConfigConfigtype, + #[serde(rename = "connectionId")] + pub connection_id: String, + #[serde(rename = "displayType")] + pub display_type: ClickStackPieRawSqlChartConfigDisplaytype, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate")] + pub sql_template: String, +} + +/// `ClickStackPieRawSqlChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackPieRawSqlChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackPieRawSqlChartConfigResponse { + #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] + pub config_type: Option, + #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] + pub connection_id: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] + pub sql_template: Option, +} + +/// `ClickStackPromqlSource` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackPromqlSource { + pub connection: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + pub from: ClickStackSourceFrom, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + pub kind: ClickStackPromqlSourceKind, + pub name: String, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde(rename = "timestampValueExpression")] + pub timestamp_value_expression: String, +} + +/// `ClickStackPromqlSource` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackPromqlSource`]: every field is `Option`, +/// so a field the API drops or sends as `null` deserializes to `None` instead +/// of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackPromqlSourceResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub connection: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub from: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde( + rename = "timestampValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub timestamp_value_expression: Option, +} + +/// `ClickStackQuerySetting` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackQuerySetting { + pub setting: String, + pub value: String, +} + +/// `ClickStackQuerySetting` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackQuerySetting`]: every field is `Option`, +/// so a field the API drops or sends as `null` deserializes to `None` instead +/// of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackQuerySettingResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub setting: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +/// `ClickStackRole` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackRole { + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "isPredefined", skip_serializing_if = "Option::is_none")] + pub is_predefined: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option>, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, +} + +/// `ClickStackSavedFilterValue` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSavedFilterValue { + pub condition: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +/// `ClickStackSavedFilterValue` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackSavedFilterValue`]: every field is +/// `Option`, so a field the API drops or sends as `null` deserializes to +/// `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSavedFilterValueResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub condition: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +/// `ClickStackSavedSearch` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSavedSearch { + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] + pub order_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(rename = "teamId", skip_serializing_if = "Option::is_none")] + pub team_id: Option, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackSavedSearchFilter` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSavedSearchFilter { + pub condition: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +/// `ClickStackSavedSearchFilter` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackSavedSearchFilter`]: every field is +/// `Option`, so a field the API drops or sends as `null` deserializes to +/// `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSavedSearchFilterResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub condition: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +/// `ClickStackSavedSearchInput` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSavedSearchInput { + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + pub name: String, + #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] + pub order_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option, + #[serde(rename = "sourceId")] + pub source_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackSearchChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSearchChartConfig { + #[serde(rename = "displayType")] + pub display_type: ClickStackSearchChartConfigDisplaytype, + pub select: String, + #[serde(rename = "sourceId")] + pub source_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage")] + pub where_language: ClickStackSearchChartConfigWherelanguage, +} + +/// `ClickStackSearchChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackSearchChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSearchChartConfigResponse { + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackSearchChartSeries` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSearchChartSeries { + pub fields: Vec, + #[serde(rename = "sourceId")] + pub source_id: String, + pub r#type: ClickStackSearchChartSeriesType, + pub r#where: String, + #[serde(rename = "whereLanguage")] + pub where_language: ClickStackSearchChartSeriesWherelanguage, +} + +/// `ClickStackSelectItem` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSelectItem { + #[serde(rename = "aggFn")] + pub agg_fn: ClickStackSelectItemAggfn, + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub level: Option, + #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] + pub metric_name: Option, + #[serde(rename = "metricType", skip_serializing_if = "Option::is_none")] + pub metric_type: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "periodAggFn", skip_serializing_if = "Option::is_none")] + pub period_agg_fn: Option, + #[serde(rename = "valueExpression", skip_serializing_if = "Option::is_none")] + pub value_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackSelectItem` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackSelectItem`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSelectItemResponse { + #[serde(rename = "aggFn", skip_serializing_if = "Option::is_none")] + pub agg_fn: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub level: Option, + #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] + pub metric_name: Option, + #[serde(rename = "metricType", skip_serializing_if = "Option::is_none")] + pub metric_type: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "periodAggFn", skip_serializing_if = "Option::is_none")] + pub period_agg_fn: Option, + #[serde(rename = "valueExpression", skip_serializing_if = "Option::is_none")] + pub value_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub r#where: Option, + #[serde(rename = "whereLanguage", skip_serializing_if = "Option::is_none")] + pub where_language: Option, +} + +/// `ClickStackSessionSource` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSessionSource { + pub connection: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + pub from: ClickStackSourceFrom, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + pub kind: ClickStackSessionSourceKind, + pub name: String, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde( + rename = "timestampValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub timestamp_value_expression: Option, + #[serde(rename = "traceSourceId")] + pub trace_source_id: String, +} + +/// `ClickStackSessionSource` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackSessionSource`]: every field is `Option`, +/// so a field the API drops or sends as `null` deserializes to `None` instead +/// of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSessionSourceResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub connection: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub from: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde( + rename = "timestampValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub timestamp_value_expression: Option, + #[serde(rename = "traceSourceId", skip_serializing_if = "Option::is_none")] + pub trace_source_id: Option, +} + +/// `ClickStackSlackAPIWebhook` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSlackAPIWebhook { + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub service: Option, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +/// `ClickStackSlackWebhook` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSlackWebhook { + #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub service: Option, + #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")] + pub updated_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +/// `ClickStackSourceFilterSettings` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSourceFilterSettings { + pub columns: Vec, + #[serde(rename = "databaseName")] + pub database_name: String, + #[serde(rename = "tableName")] + pub table_name: String, +} + +/// `ClickStackSourceFilterSettings` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackSourceFilterSettings`]: every field is +/// `Option`, so a field the API drops or sends as `null` deserializes to +/// `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSourceFilterSettingsResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub columns: Option>, + #[serde(rename = "databaseName", skip_serializing_if = "Option::is_none")] + pub database_name: Option, + #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] + pub table_name: Option, +} + +/// `ClickStackSourceFrom` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSourceFrom { + #[serde(rename = "databaseName")] + pub database_name: String, + #[serde(rename = "tableName")] + pub table_name: String, +} + +/// `ClickStackSourceFrom` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackSourceFrom`]: every field is `Option`, so +/// a field the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackSourceFromResponse { + #[serde(rename = "databaseName", skip_serializing_if = "Option::is_none")] + pub database_name: Option, + #[serde(rename = "tableName", skip_serializing_if = "Option::is_none")] + pub table_name: Option, +} + +/// `ClickStackTableBuilderChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTableBuilderChartConfig { + #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] + pub as_ratio: Option, + #[serde(rename = "displayType")] + pub display_type: ClickStackTableBuilderChartConfigDisplaytype, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde( + rename = "groupByColumnsOnLeft", + skip_serializing_if = "Option::is_none" + )] + pub group_by_columns_on_left: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub having: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "onClick", skip_serializing_if = "Option::is_none")] + pub on_click: Option, + #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] + pub order_by: Option, + pub select: Vec, + #[serde(rename = "sourceId")] + pub source_id: String, +} + +/// `ClickStackTableBuilderChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackTableBuilderChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTableBuilderChartConfigResponse { + #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] + pub as_ratio: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + #[serde( + rename = "groupByColumnsOnLeft", + skip_serializing_if = "Option::is_none" + )] + pub group_by_columns_on_left: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub having: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "onClick", skip_serializing_if = "Option::is_none")] + pub on_click: Option, + #[serde(rename = "orderBy", skip_serializing_if = "Option::is_none")] + pub order_by: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub select: Option>, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, +} + +/// `ClickStackTableChartSeries` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTableChartSeries { + #[serde(rename = "aggFn")] + pub agg_fn: ClickStackTableChartSeriesAggfn, + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub field: Option, + #[serde(rename = "groupBy")] + pub group_by: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub level: Option, + #[serde(rename = "metricDataType", skip_serializing_if = "Option::is_none")] + pub metric_data_type: Option, + #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] + pub metric_name: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sortOrder", skip_serializing_if = "Option::is_none")] + pub sort_order: Option, + #[serde(rename = "sourceId")] + pub source_id: String, + pub r#type: ClickStackTableChartSeriesType, + pub r#where: String, + #[serde(rename = "whereLanguage")] + pub where_language: ClickStackTableChartSeriesWherelanguage, +} + +/// `ClickStackTableRawSqlChartConfig` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTableRawSqlChartConfig { + #[serde(rename = "configType")] + pub config_type: ClickStackTableRawSqlChartConfigConfigtype, + #[serde(rename = "connectionId")] + pub connection_id: String, + #[serde(rename = "displayType")] + pub display_type: ClickStackTableRawSqlChartConfigDisplaytype, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "onClick", skip_serializing_if = "Option::is_none")] + pub on_click: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate")] + pub sql_template: String, +} + +/// `ClickStackTableRawSqlChartConfig` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackTableRawSqlChartConfig`]: every field is `Option`, so a field +/// the API drops or sends as `null` deserializes to `None` instead of +/// failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTableRawSqlChartConfigResponse { + #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] + pub config_type: Option, + #[serde(rename = "connectionId", skip_serializing_if = "Option::is_none")] + pub connection_id: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "onClick", skip_serializing_if = "Option::is_none")] + pub on_click: Option, + #[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "sqlTemplate", skip_serializing_if = "Option::is_none")] + pub sql_template: Option, +} + +/// `ClickStackTileInput` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTileInput { + #[cfg(feature = "deprecated-fields")] + #[serde(rename = "asRatio", skip_serializing_if = "Option::is_none")] + pub as_ratio: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub config: Option, + #[serde(rename = "containerId", skip_serializing_if = "Option::is_none")] + pub container_id: Option, + pub h: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + pub name: String, + #[cfg(feature = "deprecated-fields")] + #[serde(skip_serializing_if = "Option::is_none")] + pub series: Option>, + #[serde(rename = "tabId", skip_serializing_if = "Option::is_none")] + pub tab_id: Option, + pub w: i64, + pub x: i64, + pub y: i64, +} + +/// `ClickStackTileOutput` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTileOutput { + #[serde(skip_serializing_if = "Option::is_none")] + pub config: Option, + #[serde(rename = "containerId", skip_serializing_if = "Option::is_none")] + pub container_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub h: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "tabId", skip_serializing_if = "Option::is_none")] + pub tab_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub w: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub x: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub y: Option, +} + +/// `ClickStackTimeChartSeries` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTimeChartSeries { + #[serde(rename = "aggFn")] + pub agg_fn: ClickStackTimeChartSeriesAggfn, + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option, + #[serde(rename = "displayType", skip_serializing_if = "Option::is_none")] + pub display_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub field: Option, + #[serde(rename = "groupBy")] + pub group_by: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub level: Option, + #[serde(rename = "metricDataType", skip_serializing_if = "Option::is_none")] + pub metric_data_type: Option, + #[serde(rename = "metricName", skip_serializing_if = "Option::is_none")] + pub metric_name: Option, + #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none")] + pub number_format: Option, + #[serde(rename = "sourceId")] + pub source_id: String, + pub r#type: ClickStackTimeChartSeriesType, + pub r#where: String, + #[serde(rename = "whereLanguage")] + pub where_language: ClickStackTimeChartSeriesWherelanguage, +} + +/// `ClickStackTraceSource` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTraceSource { + pub connection: String, + #[serde(rename = "defaultTableSelectExpression")] + pub default_table_select_expression: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "durationExpression")] + pub duration_expression: String, + #[serde(rename = "durationPrecision")] + pub duration_precision: i64, + #[serde( + rename = "eventAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub event_attributes_expression: Option, + #[serde(rename = "filterSettings", skip_serializing_if = "Option::is_none")] + pub filter_settings: Option, + pub from: ClickStackSourceFrom, + #[serde( + rename = "highlightedRowAttributeExpressions", + skip_serializing_if = "Option::is_none" + )] + pub highlighted_row_attribute_expressions: + Option>, + #[serde( + rename = "highlightedTraceAttributeExpressions", + skip_serializing_if = "Option::is_none" + )] + pub highlighted_trace_attribute_expressions: + Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde( + rename = "implicitColumnExpression", + skip_serializing_if = "Option::is_none" + )] + pub implicit_column_expression: Option, + pub kind: ClickStackTraceSourceKind, + #[serde( + rename = "knownColumnsListExpression", + skip_serializing_if = "Option::is_none" + )] + pub known_columns_list_expression: Option, + #[serde(rename = "logSourceId", skip_serializing_if = "Option::is_none")] + pub log_source_id: Option, + #[serde(rename = "materializedViews", skip_serializing_if = "Option::is_none")] + pub materialized_views: Option>, + #[serde( + rename = "metadataMaterializedViews", + skip_serializing_if = "Option::is_none" + )] + pub metadata_materialized_views: Option, + #[serde(rename = "metricSourceId", skip_serializing_if = "Option::is_none")] + pub metric_source_id: Option, + pub name: String, + #[serde(rename = "parentSpanIdExpression")] + pub parent_span_id_expression: String, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde( + rename = "resourceAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub resource_attributes_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde( + rename = "serviceNameExpression", + skip_serializing_if = "Option::is_none" + )] + pub service_name_expression: Option, + #[serde(rename = "sessionSourceId", skip_serializing_if = "Option::is_none")] + pub session_source_id: Option, + #[serde( + rename = "spanEventsValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub span_events_value_expression: Option, + #[serde(rename = "spanIdExpression")] + pub span_id_expression: String, + #[serde(rename = "spanKindExpression")] + pub span_kind_expression: String, + #[serde(rename = "spanNameExpression")] + pub span_name_expression: String, + #[serde( + rename = "statusCodeExpression", + skip_serializing_if = "Option::is_none" + )] + pub status_code_expression: Option, + #[serde( + rename = "statusMessageExpression", + skip_serializing_if = "Option::is_none" + )] + pub status_message_expression: Option, + #[serde(rename = "timestampValueExpression")] + pub timestamp_value_expression: String, + #[serde(rename = "traceIdExpression")] + pub trace_id_expression: String, + #[serde( + rename = "useTextIndexForImplicitColumn", + skip_serializing_if = "Option::is_none" + )] + pub use_text_index_for_implicit_column: + Option, +} + +/// `ClickStackTraceSource` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackTraceSource`]: every field is `Option`, +/// so a field the API drops or sends as `null` deserializes to `None` instead +/// of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTraceSourceResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub connection: Option, + #[serde( + rename = "defaultTableSelectExpression", + skip_serializing_if = "Option::is_none" + )] + pub default_table_select_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + #[serde(rename = "durationExpression", skip_serializing_if = "Option::is_none")] + pub duration_expression: Option, + #[serde(rename = "durationPrecision", skip_serializing_if = "Option::is_none")] + pub duration_precision: Option, + #[serde( + rename = "eventAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub event_attributes_expression: Option, + #[serde(rename = "filterSettings", skip_serializing_if = "Option::is_none")] + pub filter_settings: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub from: Option, + #[serde( + rename = "highlightedRowAttributeExpressions", + skip_serializing_if = "Option::is_none" + )] + pub highlighted_row_attribute_expressions: + Option>, + #[serde( + rename = "highlightedTraceAttributeExpressions", + skip_serializing_if = "Option::is_none" + )] + pub highlighted_trace_attribute_expressions: + Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde( + rename = "implicitColumnExpression", + skip_serializing_if = "Option::is_none" + )] + pub implicit_column_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[serde( + rename = "knownColumnsListExpression", + skip_serializing_if = "Option::is_none" + )] + pub known_columns_list_expression: Option, + #[serde(rename = "logSourceId", skip_serializing_if = "Option::is_none")] + pub log_source_id: Option, + #[serde(rename = "materializedViews", skip_serializing_if = "Option::is_none")] + pub materialized_views: Option>, + #[serde( + rename = "metadataMaterializedViews", + skip_serializing_if = "Option::is_none" + )] + pub metadata_materialized_views: Option, + #[serde(rename = "metricSourceId", skip_serializing_if = "Option::is_none")] + pub metric_source_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde( + rename = "parentSpanIdExpression", + skip_serializing_if = "Option::is_none" + )] + pub parent_span_id_expression: Option, + #[serde(rename = "querySettings", skip_serializing_if = "Option::is_none")] + pub query_settings: Option>, + #[serde( + rename = "resourceAttributesExpression", + skip_serializing_if = "Option::is_none" + )] + pub resource_attributes_expression: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub section: Option, + #[serde( + rename = "serviceNameExpression", + skip_serializing_if = "Option::is_none" + )] + pub service_name_expression: Option, + #[serde(rename = "sessionSourceId", skip_serializing_if = "Option::is_none")] + pub session_source_id: Option, + #[serde( + rename = "spanEventsValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub span_events_value_expression: Option, + #[serde(rename = "spanIdExpression", skip_serializing_if = "Option::is_none")] + pub span_id_expression: Option, + #[serde(rename = "spanKindExpression", skip_serializing_if = "Option::is_none")] + pub span_kind_expression: Option, + #[serde(rename = "spanNameExpression", skip_serializing_if = "Option::is_none")] + pub span_name_expression: Option, + #[serde( + rename = "statusCodeExpression", + skip_serializing_if = "Option::is_none" + )] + pub status_code_expression: Option, + #[serde( + rename = "statusMessageExpression", + skip_serializing_if = "Option::is_none" + )] + pub status_message_expression: Option, + #[serde( + rename = "timestampValueExpression", + skip_serializing_if = "Option::is_none" + )] + pub timestamp_value_expression: Option, + #[serde(rename = "traceIdExpression", skip_serializing_if = "Option::is_none")] + pub trace_id_expression: Option, + #[serde( + rename = "useTextIndexForImplicitColumn", + skip_serializing_if = "Option::is_none" + )] + pub use_text_index_for_implicit_column: + Option, +} + +/// `ClickStackTraceSourceMetadataMaterializedViews` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTraceSourceMetadataMaterializedViews { + pub granularity: String, + #[serde(rename = "keyRollupTable")] + pub key_rollup_table: String, + #[serde(rename = "kvRollupTable")] + pub kv_rollup_table: String, +} + +/// `ClickStackTraceSourceMetadataMaterializedViews` from the ClickHouse Cloud API, in response position. +/// +/// Response variant of [`ClickStackTraceSourceMetadataMaterializedViews`]: +/// every field is `Option`, so a field the API drops or sends as `null` +/// deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackTraceSourceMetadataMaterializedViewsResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub granularity: Option, + #[serde(rename = "keyRollupTable", skip_serializing_if = "Option::is_none")] + pub key_rollup_table: Option, + #[serde(rename = "kvRollupTable", skip_serializing_if = "Option::is_none")] + pub kv_rollup_table: Option, +} + +/// `ClickStackUpdateAlertRequest` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackUpdateAlertRequest { + pub channel: ClickStackAlertChannel, + #[serde(rename = "dashboardId", skip_serializing_if = "Option::is_none")] + pub dashboard_id: Option, + #[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")] + pub group_by: Option, + pub interval: ClickStackUpdateAlertRequestInterval, + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub note: Option, + #[serde( + rename = "numConsecutiveWindows", + skip_serializing_if = "Option::is_none" + )] + pub num_consecutive_windows: Option, + #[serde(rename = "savedSearchId", skip_serializing_if = "Option::is_none")] + pub saved_search_id: Option, + #[serde( + rename = "scheduleOffsetMinutes", + skip_serializing_if = "Option::is_none" + )] + pub schedule_offset_minutes: Option, + #[serde(rename = "scheduleStartAt", skip_serializing_if = "Option::is_none")] + pub schedule_start_at: Option>, + pub source: ClickStackUpdateAlertRequestSource, + pub threshold: f64, + #[serde(rename = "thresholdMax", skip_serializing_if = "Option::is_none")] + pub threshold_max: Option, + #[serde(rename = "thresholdType")] + pub threshold_type: ClickStackUpdateAlertRequestThresholdtype, + #[serde(rename = "tileId", skip_serializing_if = "Option::is_none")] + pub tile_id: Option, +} + +/// `ClickStackUpdateConnectionRequest` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackUpdateConnectionRequest { + pub host: String, + #[serde( + rename = "hyperdxSettingPrefix", + skip_serializing_if = "Option::is_none" + )] + pub hyperdx_setting_prefix: Option, + #[serde( + rename = "isPrometheusEndpoint", + skip_serializing_if = "Option::is_none" + )] + pub is_prometheus_endpoint: Option, + pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub password: Option, + pub username: String, +} + +/// `ClickStackUpdateDashboardRequest` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackUpdateDashboardRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub containers: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + pub name: String, + #[serde(rename = "savedFilterValues", skip_serializing_if = "Option::is_none")] + pub saved_filter_values: Option>, + #[serde(rename = "savedQuery", skip_serializing_if = "Option::is_none")] + pub saved_query: Option, + #[serde(rename = "savedQueryLanguage", skip_serializing_if = "Option::is_none")] + pub saved_query_language: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + pub tiles: Vec, +} + +/// `ClickStackUpdateRoleRequest` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackUpdateRoleRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + pub permissions: Vec, +} + +/// `ClickStackValidateDashboardError` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackValidateDashboardError { + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +/// `ClickStackValidateDashboardResponse` from the ClickHouse Cloud API. +/// +/// Used in response position only: every field is `Option`, so a field the +/// API drops or sends as `null` deserializes to `None` instead of failing. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackValidateDashboardResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub errors: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub normalized: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub valid: Option, +} + +/// `ClickStackWebhookInput` from the ClickHouse Cloud API. +#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +pub struct ClickStackWebhookInput { + #[serde(skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub headers: Option, + pub name: String, + #[serde(rename = "queryParams", skip_serializing_if = "Option::is_none")] + pub query_params: Option, + pub service: ClickStackWebhookInputService, + pub url: String, +} + +impl Default for ClickStackAlertChannel { + fn default() -> Self { + Self::ClickStackAlertChannelEmail(ClickStackAlertChannelEmail::default()) + } +} + +impl Default for ClickStackBarChartConfig { + fn default() -> Self { + Self::ClickStackBarBuilderChartConfig(ClickStackBarBuilderChartConfig::default()) + } +} + +impl Default for ClickStackDashboardChartSeries { + fn default() -> Self { + Self::ClickStackTimeChartSeries(ClickStackTimeChartSeries::default()) + } +} + +impl Default for ClickStackLineChartConfig { + fn default() -> Self { + Self::ClickStackLineBuilderChartConfig(ClickStackLineBuilderChartConfig::default()) + } +} + +impl Default for ClickStackNumberChartConfig { + fn default() -> Self { + Self::ClickStackNumberBuilderChartConfig(ClickStackNumberBuilderChartConfig::default()) + } +} + +impl Default for ClickStackPieChartConfig { + fn default() -> Self { + Self::ClickStackPieBuilderChartConfig(ClickStackPieBuilderChartConfig::default()) + } +} + +impl Default for ClickStackSource { + fn default() -> Self { + Self::ClickStackLogSource(ClickStackLogSource::default()) + } +} + +impl Default for ClickStackTableChartConfig { + fn default() -> Self { + Self::ClickStackTableBuilderChartConfig(ClickStackTableBuilderChartConfig::default()) + } +} + +impl Default for ClickStackTileConfig { + fn default() -> Self { + Self::ClickStackLineChartConfig(ClickStackLineChartConfig::default()) + } +} + +impl Default for ClickStackWebhook { + fn default() -> Self { + // Every field of this response-only union's variants is `Option`, + // so the derived `ClickStackSlackWebhook::default()` leaves `service` + // absent and serializes to `{}` — which deserializes back through the + // discriminator dispatch as `Unknown`, not as this variant. Naming the + // variant's own wire value keeps the default round-tripping. + Self::ClickStackSlackWebhook(ClickStackSlackWebhook { + service: Some(ClickStackSlackWebhookService::default()), + ..ClickStackSlackWebhook::default() + }) + } +} diff --git a/crates/clickhouse-cloud-api/tests/model_facade_test.rs b/crates/clickhouse-cloud-api/tests/model_facade_test.rs index 3e138da..b70358e 100644 --- a/crates/clickhouse-cloud-api/tests/model_facade_test.rs +++ b/crates/clickhouse-cloud-api/tests/model_facade_test.rs @@ -18,6 +18,10 @@ fn extracted_models_keep_root_and_models_paths() { api::ClickStackChartColor::default(), api::models::ClickStackChartColor::default(), ); + assert_same_type( + api::ClickStackDashboardResponse::default(), + api::models::ClickStackDashboardResponse::default(), + ); assert_same_type(api::ClickPipe::default(), api::models::ClickPipe::default()); assert_same_type( api::ReversePrivateEndpoint::default(),