Skip to main content

incus_client/models/
image.rs

1/*
2 * Incus external REST API
3 *
4 * 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.
5 *
6 * The version of the OpenAPI document: 1.0
7 * Contact: lxc-devel@lists.linuxcontainers.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Image : Image represents an image
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Image {
17    /// List of aliases
18    #[serde(rename = "aliases", skip_serializing_if = "Option::is_none")]
19    pub aliases: Option<Vec<models::ImageAlias>>,
20    /// Architecture
21    #[serde(rename = "architecture", skip_serializing_if = "Option::is_none")]
22    pub architecture: Option<String>,
23    /// Whether the image should auto-update when a new build is available
24    #[serde(rename = "auto_update", skip_serializing_if = "Option::is_none")]
25    pub auto_update: Option<bool>,
26    /// Whether the image is an automatically cached remote image
27    #[serde(rename = "cached", skip_serializing_if = "Option::is_none")]
28    pub cached: Option<bool>,
29    /// When the image was originally created
30    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
31    pub created_at: Option<chrono::DateTime<chrono::FixedOffset>>,
32    /// When the image becomes obsolete
33    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
34    pub expires_at: Option<chrono::DateTime<chrono::FixedOffset>>,
35    /// Original filename
36    #[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
37    pub filename: Option<String>,
38    /// Full SHA-256 fingerprint
39    #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")]
40    pub fingerprint: Option<String>,
41    /// Last time the image was used
42    #[serde(rename = "last_used_at", skip_serializing_if = "Option::is_none")]
43    pub last_used_at: Option<chrono::DateTime<chrono::FixedOffset>>,
44    /// List of profiles to use when creating from this image (if none provided by user)
45    #[serde(rename = "profiles", skip_serializing_if = "Option::is_none")]
46    pub profiles: Option<Vec<String>>,
47    /// Project name
48    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
49    pub project: Option<String>,
50    /// Descriptive properties
51    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
52    pub properties: Option<std::collections::HashMap<String, String>>,
53    /// Whether the image is available to unauthenticated users
54    #[serde(rename = "public", skip_serializing_if = "Option::is_none")]
55    pub public: Option<bool>,
56    /// Size of the image in bytes
57    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
58    pub size: Option<i64>,
59    /// Type of image (container or virtual-machine)
60    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
61    pub r#type: Option<String>,
62    #[serde(rename = "update_source", skip_serializing_if = "Option::is_none")]
63    pub update_source: Option<Box<models::ImageSource>>,
64    /// When the image was added to this server
65    #[serde(rename = "uploaded_at", skip_serializing_if = "Option::is_none")]
66    pub uploaded_at: Option<chrono::DateTime<chrono::FixedOffset>>,
67}
68
69impl Image {
70    /// Image represents an image
71    pub fn new() -> Image {
72        Image {
73            aliases: None,
74            architecture: None,
75            auto_update: None,
76            cached: None,
77            created_at: None,
78            expires_at: None,
79            filename: None,
80            fingerprint: None,
81            last_used_at: None,
82            profiles: None,
83            project: None,
84            properties: None,
85            public: None,
86            size: None,
87            r#type: None,
88            update_source: None,
89            uploaded_at: None,
90        }
91    }
92}
93