/*
 * 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};

/// CreateVolumeRequest : Request model for creating a new storage volume.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateVolumeRequest {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "project")]
    pub project: String,
    #[serde(rename = "disk_interface")]
    pub disk_interface: DiskInterface,
    #[serde(rename = "region")]
    pub region: String,
    #[serde(rename = "size_gb", deserialize_with = "Option::deserialize")]
    pub size_gb: Option<serde_json::Value>,
}

impl CreateVolumeRequest {
    /// Request model for creating a new storage volume.
    pub fn new(
        name: String,
        project: String,
        disk_interface: DiskInterface,
        region: String,
        size_gb: Option<serde_json::Value>,
    ) -> CreateVolumeRequest {
        CreateVolumeRequest {
            name,
            project,
            disk_interface,
            region,
            size_gb,
        }
    }
}
///
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum DiskInterface {
    #[serde(rename = "Block")]
    #[default]
    Block,
    #[serde(rename = "File")]
    File,
}
