hotdata 0.1.2

Powerful data platform API for datasets, queries, and analytics.
Documentation
/*
 * Hotdata API
 *
 * Powerful data platform API for datasets, queries, and analytics.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: developers@hotdata.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// 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.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TableProfileResponse {
    /// Per-column profile statistics
    #[serde(rename = "columns")]
    pub columns: Vec<models::ColumnProfileInfo>,
    /// Connection name
    #[serde(rename = "connection")]
    pub connection: String,
    /// Total number of rows in the table
    #[serde(rename = "row_count")]
    pub row_count: i32,
    /// Schema name
    #[serde(rename = "schema")]
    pub schema: String,
    /// When the table was last synced
    #[serde(
        rename = "synced_at",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub synced_at: Option<Option<String>>,
    /// Table name
    #[serde(rename = "table")]
    pub table: String,
}

impl 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.
    pub fn new(
        columns: Vec<models::ColumnProfileInfo>,
        connection: String,
        row_count: i32,
        schema: String,
        table: String,
    ) -> TableProfileResponse {
        TableProfileResponse {
            columns,
            connection,
            row_count,
            schema,
            synced_at: None,
            table,
        }
    }
}