use std::fmt;
use std::borrow::Cow;
use response::NamedResponse;
use response;
#[derive(Deserialize, Debug)]
pub struct DropletUpgrade {
droplet_id: f64,
date_of_migration: String,
url: String,
}
impl response::NotArray for DropletUpgrade {}
impl fmt::Display for DropletUpgrade {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"Droplet ID: {:.0}\n\
Date of Migration: {}\n\
URL: {}",
self.droplet_id,
self.date_of_migration,
self.url)
}
}
impl NamedResponse for DropletUpgrade {
fn name<'a>() -> Cow<'a, str> {
"upgrade".into()
}
}
pub type DropletUpgrades = Vec<DropletUpgrade>;
pub type ResponseStringArray = Vec<String>;