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 CreateImageRequest {
    /// Name of the image
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// UUID of the snapshot
    #[serde(rename = "root_volume")]
    pub root_volume: String,
    /// Architecture of the image
    #[serde(rename = "arch")]
    pub arch: Arch,
    /// Default bootscript of the image
    #[serde(
        rename = "default_bootscript",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub default_bootscript: Option<Option<String>>,
    #[serde(rename = "extra_volumes", skip_serializing_if = "Option::is_none")]
    pub extra_volumes: Option<crate::models::CreateImageRequestExtraVolumes>,
    /// Organization ID of the image
    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
    pub organization: Option<String>,
    /// Project ID of the image
    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
    pub project: Option<String>,
    /// The tags of the image
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
    /// True to create a public image
    #[serde(
        rename = "public",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub public: Option<Option<bool>>,
}

impl CreateImageRequest {
    pub fn new(root_volume: String, arch: Arch) -> CreateImageRequest {
        CreateImageRequest {
            name: None,
            root_volume,
            arch,
            default_bootscript: None,
            extra_volumes: None,
            organization: None,
            project: None,
            tags: None,
            public: None,
        }
    }
}

/// Architecture of the image
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Arch {
    #[serde(rename = "x86_64")]
    X8664,
    #[serde(rename = "arm")]
    Arm,
}

impl Default for Arch {
    fn default() -> Arch {
        Self::X8664
    }
}