Skip to main content

clientapi_pve/models/
pve_memory_config.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct PveMemoryConfig {
16
17    /// Current amount of online RAM for the VM in MiB. This is the maximum available memory when you use the balloon device.
18    #[serde(rename = "current")]
19    pub current: i64,
20
21
22}
23
24impl PveMemoryConfig {
25    pub fn new(current: i64) -> PveMemoryConfig {
26        PveMemoryConfig {
27            
28            current,
29            
30        }
31    }
32}
33
34
35impl PveMemoryConfig {
36    /// Serialise this PveMemoryConfig into Proxmox's CLI-style shorthand
37    /// string (`key=value,…`). The property marked `x-pve-default-key`
38    /// is emitted positionally without a `key=` prefix; aliases collapse
39    /// multiple property names to the same wire key.
40    ///
41    /// Example: `PveMemoryConfig `
42    /// → `"virtio,bridge=vmbr0"`
43    pub fn to_shorthand(&self) -> String {
44        let mut parts: Vec<String> = Vec::new();
45        
46        
47        parts.push(format!("{}", self.current));
48        
49        
50        
51        parts.join(",")
52    }
53}
54