incus_client/models/image_metadata_template.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/// ImageMetadataTemplate : ImageMetadataTemplate represents a template entry in image metadata (used in image tarball)
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ImageMetadataTemplate {
17 /// Whether to trigger only if the file is missing
18 #[serde(rename = "create_only", skip_serializing_if = "Option::is_none")]
19 pub create_only: Option<bool>,
20 /// The file owner gid.
21 #[serde(rename = "gid", skip_serializing_if = "Option::is_none")]
22 pub gid: Option<String>,
23 /// The file permissions.
24 #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
25 pub mode: Option<String>,
26 /// Key/value properties to pass to the template
27 #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
28 pub properties: Option<std::collections::HashMap<String, String>>,
29 /// The template itself as a valid pongo2 template
30 #[serde(rename = "template", skip_serializing_if = "Option::is_none")]
31 pub template: Option<String>,
32 /// The file owner uid.
33 #[serde(rename = "uid", skip_serializing_if = "Option::is_none")]
34 pub uid: Option<String>,
35 /// When to trigger the template (create, copy or start)
36 #[serde(rename = "when", skip_serializing_if = "Option::is_none")]
37 pub when: Option<Vec<String>>,
38}
39
40impl ImageMetadataTemplate {
41 /// ImageMetadataTemplate represents a template entry in image metadata (used in image tarball)
42 pub fn new() -> ImageMetadataTemplate {
43 ImageMetadataTemplate {
44 create_only: None,
45 gid: None,
46 mode: None,
47 properties: None,
48 template: None,
49 uid: None,
50 when: None,
51 }
52 }
53}
54