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 InstancesPost {
    /// Architecture name
    #[serde(rename = "architecture", skip_serializing_if = "Option::is_none")]
    pub architecture: Option<String>,
    /// Instance configuration (see doc/instances.md)
    #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
    pub config: Option<serde_json::Value>,
    /// Instance description
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Instance devices (see doc/instances.md)
    #[serde(rename = "devices", skip_serializing_if = "Option::is_none")]
    pub devices: Option<serde_json::Value>,
    /// Whether only the instances disk should be restored
    #[serde(rename = "disk_only", skip_serializing_if = "Option::is_none")]
    pub disk_only: Option<bool>,
    /// Whether the instance is ephemeral (deleted on shutdown)
    #[serde(rename = "ephemeral", skip_serializing_if = "Option::is_none")]
    pub ephemeral: Option<bool>,
    /// Cloud instance type (AWS, GCP, Azure, ...) to emulate with limits
    #[serde(rename = "instance_type", skip_serializing_if = "Option::is_none")]
    pub instance_type: Option<String>,
    /// Instance name
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// List of profiles applied to the instance
    #[serde(rename = "profiles", skip_serializing_if = "Option::is_none")]
    pub profiles: Option<Vec<String>>,
    /// If set, instance will be restored to the provided snapshot name
    #[serde(rename = "restore", skip_serializing_if = "Option::is_none")]
    pub restore: Option<String>,
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<Box<models::InstanceSource>>,
    /// Whether to start the instance after creation
    #[serde(rename = "start", skip_serializing_if = "Option::is_none")]
    pub start: Option<bool>,
    /// Whether the instance currently has saved state on disk
    #[serde(rename = "stateful", skip_serializing_if = "Option::is_none")]
    pub stateful: Option<bool>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
}

impl InstancesPost {
    pub fn new() -> InstancesPost {
        InstancesPost {
            architecture: None,
            config: None,
            description: None,
            devices: None,
            disk_only: None,
            ephemeral: None,
            instance_type: None,
            name: None,
            profiles: None,
            restore: None,
            source: None,
            start: None,
            stateful: None,
            r#type: None,
        }
    }
}