hotdata/models/
table_profile_response.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TableProfileResponse {
17 #[serde(rename = "columns")]
19 pub columns: Vec<models::ColumnProfileInfo>,
20 #[serde(rename = "connection")]
22 pub connection: String,
23 #[serde(rename = "row_count")]
25 pub row_count: i32,
26 #[serde(rename = "schema")]
28 pub schema: String,
29 #[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 #[serde(rename = "table")]
39 pub table: String,
40}
41
42impl TableProfileResponse {
43 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}