scaleway_api_rs 0.1.8

Generated library to interact with Scaleway API.
Documentation
/*
 * Account API
 *
 * # Introduction  The Account API allows you to manage projects. Project is Scaleway’s resource management feature. Designed to help you organize your infrastructure and cloud services, the feature allows resources to be isolated and grouped into specific projects.
 *
 * The version of the OpenAPI document: v2
 *
 * Generated by: https://openapi-generator.tech
 */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SetVolumeRequest {
    /// The volumes names
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The tags of the volume
    #[serde(
        rename = "tags",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tags: Option<Option<Vec<String>>>,
    /// Show the volumes NBD export URI, this field is ignored
    #[serde(rename = "export_uri", skip_serializing_if = "Option::is_none")]
    pub export_uri: Option<String>,
    /// The volume's disk size, must be a multiple of 512 (in bytes)
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<i32>,
    /// The volume's type
    #[serde(rename = "volume_type", skip_serializing_if = "Option::is_none")]
    pub volume_type: Option<VolumeType>,
    /// The volume's creation date (RFC 3339 format)
    #[serde(
        rename = "creation_date",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub creation_date: Option<Option<String>>,
    /// The volume's modification date (RFC 3339 format)
    #[serde(
        rename = "modification_date",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub modification_date: Option<Option<String>>,
    /// The volume's organization ID
    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
    pub organization: Option<String>,
    /// The volume's project ID
    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
    pub project: Option<String>,
    #[serde(rename = "server", skip_serializing_if = "Option::is_none")]
    pub server: Option<Box<crate::models::SetVolumeRequestServer>>,
    /// The volume's state
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<State>,
}

impl SetVolumeRequest {
    pub fn new() -> SetVolumeRequest {
        SetVolumeRequest {
            name: None,
            tags: None,
            export_uri: None,
            size: None,
            volume_type: None,
            creation_date: None,
            modification_date: None,
            organization: None,
            project: None,
            server: None,
            state: None,
        }
    }
}

/// The volume's type
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum VolumeType {
    #[serde(rename = "l_ssd")]
    LSsd,
    #[serde(rename = "b_ssd")]
    BSsd,
    #[serde(rename = "unified")]
    Unified,
}

impl Default for VolumeType {
    fn default() -> VolumeType {
        Self::LSsd
    }
}
/// The volume's state
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum State {
    #[serde(rename = "available")]
    Available,
    #[serde(rename = "snapshotting")]
    Snapshotting,
    #[serde(rename = "error")]
    Error,
    #[serde(rename = "fetching")]
    Fetching,
    #[serde(rename = "resizing")]
    Resizing,
    #[serde(rename = "saving")]
    Saving,
    #[serde(rename = "hotsyncing")]
    Hotsyncing,
}

impl Default for State {
    fn default() -> State {
        Self::Available
    }
}