1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use serde::{Serialize, Deserialize};
use super::Commit;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Deploy {
pub commit: Commit,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::Utc>,
#[serde(rename = "finishedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finished_at: Option<chrono::DateTime<chrono::Utc>>,
pub id: String,
pub status: String,
#[serde(rename = "updatedAt")]
pub updated_at: chrono::DateTime<chrono::Utc>,
}
impl std::fmt::Display for Deploy {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}