use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ConnectionHealthResponse {
#[serde(rename = "connection_id")]
pub connection_id: String,
#[serde(
rename = "error",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub error: Option<Option<String>>,
#[serde(rename = "healthy")]
pub healthy: bool,
#[serde(rename = "latency_ms")]
pub latency_ms: i64,
}
impl ConnectionHealthResponse {
pub fn new(connection_id: String, healthy: bool, latency_ms: i64) -> ConnectionHealthResponse {
ConnectionHealthResponse {
connection_id,
error: None,
healthy,
latency_ms,
}
}
}