Skip to main content

hotdata/models/
table_profile_response.rs

1/*
2 * Hotdata API
3 *
4 * Powerful data platform API for managed databases, queries, and analytics.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * Contact: developers@hotdata.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// TableProfileResponse : Column-level statistics for a synced table. Profiles are computed at sync time and include per-column cardinality, null counts, and type-specific details.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TableProfileResponse {
17    /// Per-column profile statistics
18    #[serde(rename = "columns")]
19    pub columns: Vec<models::ColumnProfileInfo>,
20    /// Connection name
21    #[serde(rename = "connection")]
22    pub connection: String,
23    /// Total number of rows in the table
24    #[serde(rename = "row_count")]
25    pub row_count: i32,
26    /// Schema name
27    #[serde(rename = "schema")]
28    pub schema: String,
29    /// When the table was last synced
30    #[serde(
31        rename = "synced_at",
32        default,
33        with = "::serde_with::rust::double_option",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub synced_at: Option<Option<String>>,
37    /// Table name
38    #[serde(rename = "table")]
39    pub table: String,
40}
41
42impl TableProfileResponse {
43    /// Column-level statistics for a synced table. Profiles are computed at sync time and include per-column cardinality, null counts, and type-specific details.
44    pub fn new(
45        columns: Vec<models::ColumnProfileInfo>,
46        connection: String,
47        row_count: i32,
48        schema: String,
49        table: String,
50    ) -> TableProfileResponse {
51        TableProfileResponse {
52            columns,
53            connection,
54            row_count,
55            schema,
56            synced_at: None,
57            table,
58        }
59    }
60}