use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ConnectionRefreshResult {
#[serde(rename = "connection_id")]
pub connection_id: String,
#[serde(rename = "duration_ms")]
pub duration_ms: i64,
#[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<models::TableRefreshError>>,
#[serde(rename = "tables_failed")]
pub tables_failed: i32,
#[serde(rename = "tables_refreshed")]
pub tables_refreshed: i32,
#[serde(rename = "total_rows")]
pub total_rows: i32,
#[serde(rename = "warnings", skip_serializing_if = "Option::is_none")]
pub warnings: Option<Vec<models::RefreshWarning>>,
}
impl ConnectionRefreshResult {
pub fn new(
connection_id: String,
duration_ms: i64,
tables_failed: i32,
tables_refreshed: i32,
total_rows: i32,
) -> ConnectionRefreshResult {
ConnectionRefreshResult {
connection_id,
duration_ms,
errors: None,
tables_failed,
tables_refreshed,
total_rows,
warnings: None,
}
}
}