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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InstanceSource {
    /// Image alias name (for image source)
    #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
    pub alias: Option<String>,
    /// Whether to ignore errors when copying (e.g. for volatile files)
    #[serde(rename = "allow_inconsistent", skip_serializing_if = "Option::is_none")]
    pub allow_inconsistent: Option<bool>,
    /// Base image fingerprint (for faster migration)
    #[serde(rename = "base-image", skip_serializing_if = "Option::is_none")]
    pub base_image: Option<String>,
    /// Certificate (for remote images or migration)
    #[serde(rename = "certificate", skip_serializing_if = "Option::is_none")]
    pub certificate: Option<String>,
    /// Image fingerprint (for image source)
    #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")]
    pub fingerprint: Option<String>,
    /// Whether the copy should skip the snapshots (for copy)
    #[serde(rename = "instance_only", skip_serializing_if = "Option::is_none")]
    pub instance_only: Option<bool>,
    /// Whether this is a live migration (for migration)
    #[serde(rename = "live", skip_serializing_if = "Option::is_none")]
    pub live: Option<bool>,
    /// Whether to use pull or push mode (for migration)
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<String>,
    /// Remote operation URL (for migration)
    #[serde(rename = "operation", skip_serializing_if = "Option::is_none")]
    pub operation: Option<String>,
    /// Source project name (for copy and local image)
    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
    pub project: Option<String>,
    /// Image filters (for image source)
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
    pub properties: Option<std::collections::HashMap<String, String>>,
    /// Protocol name (for remote image)
    #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")]
    pub protocol: Option<String>,
    /// Whether this is refreshing an existing instance (for migration and copy)
    #[serde(rename = "refresh", skip_serializing_if = "Option::is_none")]
    pub refresh: Option<bool>,
    /// Whether to exclude source snapshots earlier than latest target snapshot
    #[serde(rename = "refresh_exclude_older", skip_serializing_if = "Option::is_none")]
    pub refresh_exclude_older: Option<bool>,
    /// Remote server secret (for remote private images)
    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
    pub secret: Option<String>,
    /// Map of migration websockets (for migration)
    #[serde(rename = "secrets", skip_serializing_if = "Option::is_none")]
    pub secrets: Option<std::collections::HashMap<String, String>>,
    /// Remote server URL (for remote images)
    #[serde(rename = "server", skip_serializing_if = "Option::is_none")]
    pub server: Option<String>,
    /// Existing instance name or snapshot (for copy)
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
    /// Source type
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
}

impl InstanceSource {
    pub fn new() -> InstanceSource {
        InstanceSource {
            alias: None,
            allow_inconsistent: None,
            base_image: None,
            certificate: None,
            fingerprint: None,
            instance_only: None,
            live: None,
            mode: None,
            operation: None,
            project: None,
            properties: None,
            protocol: None,
            refresh: None,
            refresh_exclude_older: None,
            secret: None,
            secrets: None,
            server: None,
            source: None,
            r#type: None,
        }
    }
}