/*
 * Mithril
 *
 * Mithril Compute API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VolumeModel {
    #[serde(rename = "fid")]
    pub fid: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "region")]
    pub region: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "capacity_gb")]
    pub capacity_gb: i32,
    #[serde(rename = "project")]
    pub project: String,
    #[serde(rename = "interface")]
    pub interface: Interface,
    #[serde(rename = "bids")]
    pub bids: Vec<String>,
    #[serde(rename = "reservations")]
    pub reservations: Vec<String>,
    #[serde(rename = "attachments")]
    pub attachments: std::collections::HashMap<String, String>,
}

impl VolumeModel {
    pub fn new(
        fid: String,
        name: String,
        region: String,
        created_at: String,
        capacity_gb: i32,
        project: String,
        interface: Interface,
        bids: Vec<String>,
        reservations: Vec<String>,
        attachments: std::collections::HashMap<String, String>,
    ) -> VolumeModel {
        VolumeModel {
            fid,
            name,
            region,
            created_at,
            capacity_gb,
            project,
            interface,
            bids,
            reservations,
            attachments,
        }
    }
}
///
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Interface {
    #[serde(rename = "Block")]
    #[default]
    Block,
    #[serde(rename = "File")]
    File,
}
