use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(test, derive(Default))]
pub struct BackupRestorationList {
#[serde(rename = "total")]
pub total: i64,
#[serde(rename = "restorations")]
pub restorations: Vec<crate::models::BackupRestoration>,
}
impl BackupRestorationList {
pub fn total(&self) -> &i64 {
&self.total
}
pub fn restorations(&self) -> &Vec<crate::models::BackupRestoration> {
&self.restorations
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_backup_restoration_list_creation() {
let _model = <BackupRestorationList as Default>::default();
let _ = _model.total();
let _ = _model.restorations();
}
#[test]
fn test_backup_restoration_list_serialization() {
let model = <BackupRestorationList as Default>::default();
let json = serde_json::to_string(&model);
assert!(json.is_ok());
let deserialized: Result<BackupRestorationList, _> = serde_json::from_str(&json.unwrap());
assert!(deserialized.is_ok());
}
}