#![allow(non_snake_case)]
#![allow(missing_docs)]
use chrono::{DateTime, FixedOffset};
use serde::Deserialize;
protocol_enum! {
#[doc = "Possible image statuses."]
enum ImageStatus {
Queued = "queued",
Saving = "saving",
Active = "active",
Killed = "killed",
Deleted = "deleted",
PendingDelete = "pending_delete",
Deactivated = "deactivated"
}
}
protocol_enum! {
#[doc = "Possible image visibility values."]
enum ImageVisibility {
Public = "public",
Community = "community",
Shared = "shared",
Private = "private"
}
}
protocol_enum! {
#[doc = "Possible container formats."]
enum ImageContainerFormat {
AMI = "ami",
ARI = "ari",
AKI = "aki",
Bare = "bare",
OVF = "ovf",
OVA = "ova",
Docker = "docker"
}
}
protocol_enum! {
#[doc = "Possible disk formats."]
enum ImageDiskFormat {
AMI = "ami",
ARI = "ari",
AKI = "aki",
VHD = "vhd",
VHDX = "vhdx",
VMDK = "vmdk",
Raw = "raw",
QCOW2 = "qcow2",
VDI = "vdi",
ISO = "iso",
Ploop = "ploop"
}
}
protocol_enum! {
#[doc = "Available sort keys."]
enum ImageSortKey {
CreatedAt = "created_at",
Id = "id",
Name = "name",
UpdatedAt = "updated_at"
}
}
impl Default for ImageSortKey {
fn default() -> ImageSortKey {
ImageSortKey::CreatedAt
}
}
#[derive(Debug, Clone, Deserialize)]
pub struct Image {
#[serde(default)]
pub architecture: Option<String>,
#[serde(default)]
pub checksum: Option<String>,
#[serde(default)]
pub container_format: Option<ImageContainerFormat>,
pub created_at: DateTime<FixedOffset>,
#[serde(default)]
pub disk_format: Option<ImageDiskFormat>,
pub id: String,
#[serde(default)]
pub min_disk: u32,
#[serde(default)]
pub min_ram: u32,
pub name: String,
#[serde(default)]
pub size: Option<u64>,
pub status: ImageStatus,
pub updated_at: DateTime<FixedOffset>,
#[serde(default)]
pub virtual_size: Option<u64>,
pub visibility: ImageVisibility,
}
#[derive(Debug, Clone, Deserialize)]
pub struct ImagesRoot {
pub images: Vec<Image>,
}