incus-client 0.1.1

Auto-generated Rust client for the Incus container and VM manager REST API
Documentation
/*
 * Incus external REST API
 *
 * This is the REST API used by all Incus clients. Internal endpoints aren't included in this documentation.  The Incus API is available over both a local unix+http and remote https API. Authentication for local users relies on group membership and access to the unix socket. For remote users, the default authentication method is TLS client certificates.
 *
 * The version of the OpenAPI document: 1.0
 * Contact: lxc-devel@lists.linuxcontainers.org
 * Generated by: https://openapi-generator.tech
 */

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

/// Image : Image represents an image
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Image {
    /// List of aliases
    #[serde(rename = "aliases", skip_serializing_if = "Option::is_none")]
    pub aliases: Option<Vec<models::ImageAlias>>,
    /// Architecture
    #[serde(rename = "architecture", skip_serializing_if = "Option::is_none")]
    pub architecture: Option<String>,
    /// Whether the image should auto-update when a new build is available
    #[serde(rename = "auto_update", skip_serializing_if = "Option::is_none")]
    pub auto_update: Option<bool>,
    /// Whether the image is an automatically cached remote image
    #[serde(rename = "cached", skip_serializing_if = "Option::is_none")]
    pub cached: Option<bool>,
    /// When the image was originally created
    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<chrono::DateTime<chrono::FixedOffset>>,
    /// When the image becomes obsolete
    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<chrono::DateTime<chrono::FixedOffset>>,
    /// Original filename
    #[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
    pub filename: Option<String>,
    /// Full SHA-256 fingerprint
    #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")]
    pub fingerprint: Option<String>,
    /// Last time the image was used
    #[serde(rename = "last_used_at", skip_serializing_if = "Option::is_none")]
    pub last_used_at: Option<chrono::DateTime<chrono::FixedOffset>>,
    /// List of profiles to use when creating from this image (if none provided by user)
    #[serde(rename = "profiles", skip_serializing_if = "Option::is_none")]
    pub profiles: Option<Vec<String>>,
    /// Project name
    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
    pub project: Option<String>,
    /// Descriptive properties
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
    pub properties: Option<std::collections::HashMap<String, String>>,
    /// Whether the image is available to unauthenticated users
    #[serde(rename = "public", skip_serializing_if = "Option::is_none")]
    pub public: Option<bool>,
    /// Size of the image in bytes
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<i64>,
    /// Type of image (container or virtual-machine)
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "update_source", skip_serializing_if = "Option::is_none")]
    pub update_source: Option<Box<models::ImageSource>>,
    /// When the image was added to this server
    #[serde(rename = "uploaded_at", skip_serializing_if = "Option::is_none")]
    pub uploaded_at: Option<chrono::DateTime<chrono::FixedOffset>>,
}

impl Image {
    /// Image represents an image
    pub fn new() -> Image {
        Image {
            aliases: None,
            architecture: None,
            auto_update: None,
            cached: None,
            created_at: None,
            expires_at: None,
            filename: None,
            fingerprint: None,
            last_used_at: None,
            profiles: None,
            project: None,
            properties: None,
            public: None,
            size: None,
            r#type: None,
            update_source: None,
            uploaded_at: None,
        }
    }
}