Skip to main content

clientapi_pve/models/
qemu_update_vm_request.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)]
15pub struct QemuUpdateVmRequest {
16
17
18    /// Enable/disable ACPI.
19    pub acpi: Option<models::PveBoolean>,
20
21    /// List of host cores used to execute guest processes, for example: 0,5,8-11
22    pub affinity: Option<String>,
23
24    /// Enable/disable communication with the QEMU Guest Agent and its properties.
25    pub agent: Option<Box<models::PveAgentField>>,
26
27    /// Allow memory pages of this guest to be merged via KSM (Kernel Samepage Merging).
28    pub allow_ksm: Option<models::PveBoolean>,
29
30    /// Secure Encrypted Virtualization (SEV) features by AMD CPUs
31    pub amd_sev: Option<String>,
32
33    /// Virtual processor architecture. Defaults to the host architecture.
34    pub arch: Option<models::PveArchEnum>,
35
36    /// Arbitrary arguments passed to kvm, for example:  args: -no-reboot -smbios 'type=0,vendor=FOO'  NOTE: this option is for experts only. 
37    pub args: Option<String>,
38
39    /// Configure a audio device, useful in combination with QXL/Spice.
40    pub audio0: Option<Box<models::PveAudioField>>,
41
42    /// Automatic restart after crash (currently ignored).
43    pub autostart: Option<models::PveBoolean>,
44
45    /// Amount of target RAM for the VM in MiB. The balloon driver is enabled by default, unless it is explicitly disabled by setting the value to zero.
46    pub balloon: Option<i64>,
47
48    /// Select BIOS implementation.
49    pub bios: Option<models::PveBiosEnum>,
50
51    /// Specify guest boot order. Use the 'order=' sub-property as usage with no key or 'legacy=' is deprecated.
52    pub boot: Option<String>,
53
54    /// Enable booting from specified disk. Deprecated: Use 'boot: order=foo;bar' instead.
55    pub bootdisk: Option<String>,
56
57    /// This is an alias for option -ide2
58    pub cdrom: Option<String>,
59
60    /// cloud-init: Specify custom files to replace the automatically generated ones at start.
61    pub cicustom: Option<String>,
62
63    /// cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead. Also note that older cloud-init versions do not support hashed passwords.
64    pub cipassword: Option<String>,
65
66    /// Specifies the cloud-init configuration format. The default depends on the configured operating system type (`ostype`. We use the `nocloud` format for Linux, and `configdrive2` for windows.
67    pub citype: Option<models::PveCitypeEnum>,
68
69    /// cloud-init: do an automatic package upgrade after the first boot.
70    pub ciupgrade: Option<models::PveBoolean>,
71
72    /// cloud-init: User name to change ssh keys and password for instead of the image's configured default user.
73    pub ciuser: Option<String>,
74
75    /// The number of cores per socket.
76    pub cores: Option<i64>,
77
78    /// Emulated CPU type.
79    pub cpu: Option<String>,
80
81    /// Limit of CPU usage.  NOTE: If the computer has 2 CPUs, it has total of '2' CPU time. Value '0' indicates no CPU limit.
82    pub cpulimit: Option<f64>,
83
84    /// CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs.
85    pub cpuunits: Option<i32>,
86
87    /// A list of settings you want to delete.
88    pub delete: Option<String>,
89
90    /// Description for the VM. Shown in the web-interface VM's summary. This is saved as comment inside the configuration file.
91    pub description: Option<String>,
92
93    /// Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
94    pub digest: Option<String>,
95
96    /// Configure a disk for storing EFI vars. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Note that SIZE_IN_GiB is ignored here and that the default EFI vars are copied to the volume instead. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume.
97    pub efidisk0: Option<Box<models::PveEfidiskField>>,
98
99    /// Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal.
100    pub force: Option<models::PveBoolean>,
101
102    /// Freeze CPU at startup (use 'c' monitor command to start execution).
103    pub freeze: Option<models::PveBoolean>,
104
105    /// Script that will be executed during various steps in the vms lifetime.
106    pub hookscript: Option<String>,
107
108    /// Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory', 'usb' and 'cloudinit'. Use '0' to disable hotplug completely. Using '1' as value is an alias for the default `network,disk,usb`. USB hotplugging is possible for guests with machine version >= 7.1 and ostype l26 or windows > 7.
109    pub hotplug: Option<String>,
110
111    /// Enables hugepages memory.  Sets the size of hugepages in MiB. If the value is set to 'any' then 1 GiB hugepages will be used if possible, otherwise the size will fall back to 2 MiB.
112    pub hugepages: Option<models::PveHugepagesEnum>,
113
114    /// Trusted Domain Extension (TDX) features by Intel CPUs
115    pub intel_tdx: Option<String>,
116
117    /// Inter-VM shared memory. Useful for direct communication between VMs, or to the host.
118    pub ivshmem: Option<Box<models::PveIvshmemField>>,
119
120    /// Use together with hugepages. If enabled, hugepages will not not be deleted after VM shutdown and can be used for subsequent starts.
121    pub keephugepages: Option<models::PveBoolean>,
122
123    /// Keyboard layout for VNC server. This option is generally not required and is often better handled from within the guest OS.
124    pub keyboard: Option<models::PveKeyboardEnum>,
125
126    /// Enable/disable KVM hardware virtualization.
127    pub kvm: Option<models::PveBoolean>,
128
129    /// Set the real time clock (RTC) to local time. This is enabled by default if the `ostype` indicates a Microsoft Windows OS.
130    pub localtime: Option<models::PveBoolean>,
131
132    /// Lock/unlock the VM.
133    pub lock: Option<models::PveQemuLockEnum>,
134
135    /// Specify the QEMU machine.
136    pub machine: Option<Box<models::PveMachineField>>,
137
138    /// Memory properties.
139    pub memory: Option<Box<models::PveMemoryField>>,
140
141    /// Set maximum tolerated downtime (in seconds) for migrations. Should the migration not be able to converge in the very end, because too much newly dirtied RAM needs to be transferred, the limit will be increased automatically step-by-step until migration can converge. Will be capped to 2000 seconds (maximum in QEMU).
142    pub migrate_downtime: Option<f64>,
143
144    /// Set maximum speed (in MB/s) for migrations. Value 0 is no limit.
145    pub migrate_speed: Option<i64>,
146
147    /// Set a name for the VM. Only used on the configuration web interface.
148    pub name: Option<String>,
149
150    /// cloud-init: Sets DNS server IP address for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set.
151    pub nameserver: Option<String>,
152
153    /// Enable/disable NUMA.
154    pub numa: Option<models::PveBoolean>,
155
156    /// Specifies whether a VM will be started during system bootup.
157    pub onboot: Option<models::PveBoolean>,
158
159    /// Specify guest operating system. This is used to enable special optimization/features for specific operating systems:  [horizontal] other;; unspecified OS wxp;; Microsoft Windows XP w2k;; Microsoft Windows 2000 w2k3;; Microsoft Windows 2003 w2k8;; Microsoft Windows 2008 wvista;; Microsoft Windows Vista win7;; Microsoft Windows 7 win8;; Microsoft Windows 8/2012/2012r2 win10;; Microsoft Windows 10/2016/2019 win11;; Microsoft Windows 11/2022/2025 l24;; Linux 2.4 Kernel l26;; Linux 2.6 - 7.X Kernel solaris;; Solaris/OpenSolaris/OpenIndiania kernel 
160    pub ostype: Option<models::PveQemuOstypeEnum>,
161
162    /// Sets the protection flag of the VM. This will disable the remove VM and remove disk operations.
163    pub protection: Option<models::PveBoolean>,
164
165    /// Allow reboot. If set to '0' the VM exit on reboot.
166    pub reboot: Option<models::PveBoolean>,
167
168    /// Revert a pending change.
169    pub revert: Option<String>,
170
171    /// Configure a VirtIO-based Random Number Generator.
172    pub rng0: Option<String>,
173
174    /// SCSI controller model
175    pub scsihw: Option<models::PveScsihwEnum>,
176
177    /// cloud-init: Sets DNS search domains for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set.
178    pub searchdomain: Option<String>,
179
180    /// Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning. Auto-ballooning is done by pvestatd.
181    pub shares: Option<i32>,
182
183    /// Ignore locks - only root is allowed to use this option.
184    pub skiplock: Option<models::PveBoolean>,
185
186    /// Specify SMBIOS type 1 fields.
187    pub smbios1: Option<String>,
188
189    /// The number of CPUs. Please use option -sockets instead.
190    pub smp: Option<i64>,
191
192    /// The number of CPU sockets.
193    pub sockets: Option<i64>,
194
195    /// Configure additional enhancements for SPICE.
196    pub spice_enhancements: Option<Box<models::PveSpiceEnhancementsField>>,
197
198    /// cloud-init: Setup public SSH keys (one key per line, OpenSSH format).
199    pub sshkeys: Option<String>,
200
201    /// Set the initial date of the real time clock. Valid format for date are:'now' or '2006-06-17T16:01:21' or '2006-06-17'.
202    pub startdate: Option<String>,
203
204    /// Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.
205    pub startup: Option<String>,
206
207    /// Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. Else the mouse runs out of sync with normal VNC clients. If you're running lots of console-only guests on one host, you may consider disabling this to save some context switches. This is turned off by default if you use spice (`qm set <vmid> --vga qxl`).
208    pub tablet: Option<models::PveBoolean>,
209
210    /// Tags of the VM. This is only meta information.
211    pub tags: Option<String>,
212
213    /// Enable/disable time drift fix.
214    pub tdf: Option<models::PveBoolean>,
215
216    /// Enable/disable Template.
217    pub template: Option<models::PveBoolean>,
218
219    /// Configure a Disk for storing TPM state. The format is fixed to 'raw'. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Note that SIZE_IN_GiB is ignored here and 4 MiB will be used instead. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume.
220    pub tpmstate0: Option<Box<models::PveTpmstateField>>,
221
222    /// Number of hotplugged vcpus.
223    pub vcpus: Option<i64>,
224
225    /// Configure the VGA Hardware. If you want to use high resolution modes (>= 1280x1024x16) you may need to increase the vga memory option. Since QEMU 2.9 the default VGA display type is 'std' for all OS types besides some Windows versions (XP and older) which use 'cirrus'. The 'qxl' option enables the SPICE display server. For win* OS you can select how many independent displays you want, Linux guests can add displays them self. You can also run without any graphic card, using a serial device as terminal.
226    pub vga: Option<Box<models::PveVgaField>>,
227
228    /// The VM generation ID (vmgenid) device exposes a 128-bit integer value identifier to the guest OS. This allows to notify the guest operating system when the virtual machine is executed with a different configuration (e.g. snapshot execution or creation from a template). The guest operating system notices the change, and is then able to react as appropriate by marking its copies of distributed databases as dirty, re-initializing its random number generator, etc. Note that auto-creation only works when done through API/CLI create or update methods, but not when manually editing the config file.
229    pub vmgenid: Option<String>,
230
231    /// Default storage for VM state volumes/files.
232    pub vmstatestorage: Option<String>,
233
234    /// Create a virtual hardware watchdog device. Once enabled (by a guest action), the watchdog must be periodically polled by an agent inside the guest or else the watchdog will reset the guest (or execute the respective action specified)
235    pub watchdog: Option<String>,
236
237    /// Hostpcis family. Wire form: `hostpci0..hostpci15`. Serialised by the manual impls below.
238    pub hostpcis: Option<std::collections::HashMap<u32, String>>,
239    /// Ides family. Wire form: `ide0..ide3`. Serialised by the manual impls below.
240    pub ides: Option<std::collections::HashMap<u32, models::PveIdeField>>,
241    /// Ipconfigs family. Wire form: `ipconfig0..ipconfig31`. Serialised by the manual impls below.
242    pub ipconfigs: Option<std::collections::HashMap<u32, String>>,
243    /// Nets family. Wire form: `net0..net31`. Serialised by the manual impls below.
244    pub nets: Option<std::collections::HashMap<u32, models::PveQemuNetField>>,
245    /// Numas family. Wire form: `numa0..numa7`. Serialised by the manual impls below.
246    pub numas: Option<std::collections::HashMap<u32, models::PveNumaField>>,
247    /// Parallels family. Wire form: `parallel0..parallel2`. Serialised by the manual impls below.
248    pub parallels: Option<std::collections::HashMap<u32, String>>,
249    /// Satas family. Wire form: `sata0..sata5`. Serialised by the manual impls below.
250    pub satas: Option<std::collections::HashMap<u32, models::PveSataField>>,
251    /// Scsis family. Wire form: `scsi0..scsi30`. Serialised by the manual impls below.
252    pub scsis: Option<std::collections::HashMap<u32, models::PveScsiField>>,
253    /// Serials family. Wire form: `serial0..serial3`. Serialised by the manual impls below.
254    pub serials: Option<std::collections::HashMap<u32, String>>,
255    /// Unuseds family. Wire form: `unused0..unused255`. Serialised by the manual impls below.
256    pub unuseds: Option<std::collections::HashMap<u32, models::PveQemuUnusedField>>,
257    /// Usbs family. Wire form: `usb0..usb4`. Serialised by the manual impls below.
258    pub usbs: Option<std::collections::HashMap<u32, models::PveUsbField>>,
259    /// Virtiofs family. Wire form: `virtiofs0..virtiofs8`. Serialised by the manual impls below.
260    pub virtiofs: Option<std::collections::HashMap<u32, models::PveVirtiofsField>>,
261    /// Virtios family. Wire form: `virtio0..virtio15`. Serialised by the manual impls below.
262    pub virtios: Option<std::collections::HashMap<u32, models::PveVirtioField>>,
263}
264
265impl QemuUpdateVmRequest {
266    pub fn new() -> QemuUpdateVmRequest {
267        QemuUpdateVmRequest {
268            
269            acpi: None,
270            
271            affinity: None,
272            
273            agent: None,
274            
275            allow_ksm: None,
276            
277            amd_sev: None,
278            
279            arch: None,
280            
281            args: None,
282            
283            audio0: None,
284            
285            autostart: None,
286            
287            balloon: None,
288            
289            bios: None,
290            
291            boot: None,
292            
293            bootdisk: None,
294            
295            cdrom: None,
296            
297            cicustom: None,
298            
299            cipassword: None,
300            
301            citype: None,
302            
303            ciupgrade: None,
304            
305            ciuser: None,
306            
307            cores: None,
308            
309            cpu: None,
310            
311            cpulimit: None,
312            
313            cpuunits: None,
314            
315            delete: None,
316            
317            description: None,
318            
319            digest: None,
320            
321            efidisk0: None,
322            
323            force: None,
324            
325            freeze: None,
326            
327            hookscript: None,
328            
329            hotplug: None,
330            
331            hugepages: None,
332            
333            intel_tdx: None,
334            
335            ivshmem: None,
336            
337            keephugepages: None,
338            
339            keyboard: None,
340            
341            kvm: None,
342            
343            localtime: None,
344            
345            lock: None,
346            
347            machine: None,
348            
349            memory: None,
350            
351            migrate_downtime: None,
352            
353            migrate_speed: None,
354            
355            name: None,
356            
357            nameserver: None,
358            
359            numa: None,
360            
361            onboot: None,
362            
363            ostype: None,
364            
365            protection: None,
366            
367            reboot: None,
368            
369            revert: None,
370            
371            rng0: None,
372            
373            scsihw: None,
374            
375            searchdomain: None,
376            
377            shares: None,
378            
379            skiplock: None,
380            
381            smbios1: None,
382            
383            smp: None,
384            
385            sockets: None,
386            
387            spice_enhancements: None,
388            
389            sshkeys: None,
390            
391            startdate: None,
392            
393            startup: None,
394            
395            tablet: None,
396            
397            tags: None,
398            
399            tdf: None,
400            
401            template: None,
402            
403            tpmstate0: None,
404            
405            vcpus: None,
406            
407            vga: None,
408            
409            vmgenid: None,
410            
411            vmstatestorage: None,
412            
413            watchdog: None,
414            
415            hostpcis: None,
416            ides: None,
417            ipconfigs: None,
418            nets: None,
419            numas: None,
420            parallels: None,
421            satas: None,
422            scsis: None,
423            serials: None,
424            unuseds: None,
425            usbs: None,
426            virtiofs: None,
427            virtios: None,
428        }
429    }
430}
431
432
433// Flattens indexed-family maps to/from `<base><idx>` wire keys.
434impl serde::Serialize for QemuUpdateVmRequest {
435    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
436        use serde::ser::Error;
437        let mut map = serde_json::Map::new();
438        
439        {
440            let _v = serde_json::to_value(&self.acpi).map_err(Error::custom)?;
441            if !_v.is_null() {
442                map.insert("acpi".to_string(), _v);
443            }
444        }
445        
446        {
447            let _v = serde_json::to_value(&self.affinity).map_err(Error::custom)?;
448            if !_v.is_null() {
449                map.insert("affinity".to_string(), _v);
450            }
451        }
452        
453        {
454            let _v = serde_json::to_value(&self.agent).map_err(Error::custom)?;
455            if !_v.is_null() {
456                map.insert("agent".to_string(), _v);
457            }
458        }
459        
460        {
461            let _v = serde_json::to_value(&self.allow_ksm).map_err(Error::custom)?;
462            if !_v.is_null() {
463                map.insert("allow-ksm".to_string(), _v);
464            }
465        }
466        
467        {
468            let _v = serde_json::to_value(&self.amd_sev).map_err(Error::custom)?;
469            if !_v.is_null() {
470                map.insert("amd-sev".to_string(), _v);
471            }
472        }
473        
474        {
475            let _v = serde_json::to_value(&self.arch).map_err(Error::custom)?;
476            if !_v.is_null() {
477                map.insert("arch".to_string(), _v);
478            }
479        }
480        
481        {
482            let _v = serde_json::to_value(&self.args).map_err(Error::custom)?;
483            if !_v.is_null() {
484                map.insert("args".to_string(), _v);
485            }
486        }
487        
488        {
489            let _v = serde_json::to_value(&self.audio0).map_err(Error::custom)?;
490            if !_v.is_null() {
491                map.insert("audio0".to_string(), _v);
492            }
493        }
494        
495        {
496            let _v = serde_json::to_value(&self.autostart).map_err(Error::custom)?;
497            if !_v.is_null() {
498                map.insert("autostart".to_string(), _v);
499            }
500        }
501        
502        {
503            let _v = serde_json::to_value(&self.balloon).map_err(Error::custom)?;
504            if !_v.is_null() {
505                map.insert("balloon".to_string(), _v);
506            }
507        }
508        
509        {
510            let _v = serde_json::to_value(&self.bios).map_err(Error::custom)?;
511            if !_v.is_null() {
512                map.insert("bios".to_string(), _v);
513            }
514        }
515        
516        {
517            let _v = serde_json::to_value(&self.boot).map_err(Error::custom)?;
518            if !_v.is_null() {
519                map.insert("boot".to_string(), _v);
520            }
521        }
522        
523        {
524            let _v = serde_json::to_value(&self.bootdisk).map_err(Error::custom)?;
525            if !_v.is_null() {
526                map.insert("bootdisk".to_string(), _v);
527            }
528        }
529        
530        {
531            let _v = serde_json::to_value(&self.cdrom).map_err(Error::custom)?;
532            if !_v.is_null() {
533                map.insert("cdrom".to_string(), _v);
534            }
535        }
536        
537        {
538            let _v = serde_json::to_value(&self.cicustom).map_err(Error::custom)?;
539            if !_v.is_null() {
540                map.insert("cicustom".to_string(), _v);
541            }
542        }
543        
544        {
545            let _v = serde_json::to_value(&self.cipassword).map_err(Error::custom)?;
546            if !_v.is_null() {
547                map.insert("cipassword".to_string(), _v);
548            }
549        }
550        
551        {
552            let _v = serde_json::to_value(&self.citype).map_err(Error::custom)?;
553            if !_v.is_null() {
554                map.insert("citype".to_string(), _v);
555            }
556        }
557        
558        {
559            let _v = serde_json::to_value(&self.ciupgrade).map_err(Error::custom)?;
560            if !_v.is_null() {
561                map.insert("ciupgrade".to_string(), _v);
562            }
563        }
564        
565        {
566            let _v = serde_json::to_value(&self.ciuser).map_err(Error::custom)?;
567            if !_v.is_null() {
568                map.insert("ciuser".to_string(), _v);
569            }
570        }
571        
572        {
573            let _v = serde_json::to_value(&self.cores).map_err(Error::custom)?;
574            if !_v.is_null() {
575                map.insert("cores".to_string(), _v);
576            }
577        }
578        
579        {
580            let _v = serde_json::to_value(&self.cpu).map_err(Error::custom)?;
581            if !_v.is_null() {
582                map.insert("cpu".to_string(), _v);
583            }
584        }
585        
586        {
587            let _v = serde_json::to_value(&self.cpulimit).map_err(Error::custom)?;
588            if !_v.is_null() {
589                map.insert("cpulimit".to_string(), _v);
590            }
591        }
592        
593        {
594            let _v = serde_json::to_value(&self.cpuunits).map_err(Error::custom)?;
595            if !_v.is_null() {
596                map.insert("cpuunits".to_string(), _v);
597            }
598        }
599        
600        {
601            let _v = serde_json::to_value(&self.delete).map_err(Error::custom)?;
602            if !_v.is_null() {
603                map.insert("delete".to_string(), _v);
604            }
605        }
606        
607        {
608            let _v = serde_json::to_value(&self.description).map_err(Error::custom)?;
609            if !_v.is_null() {
610                map.insert("description".to_string(), _v);
611            }
612        }
613        
614        {
615            let _v = serde_json::to_value(&self.digest).map_err(Error::custom)?;
616            if !_v.is_null() {
617                map.insert("digest".to_string(), _v);
618            }
619        }
620        
621        {
622            let _v = serde_json::to_value(&self.efidisk0).map_err(Error::custom)?;
623            if !_v.is_null() {
624                map.insert("efidisk0".to_string(), _v);
625            }
626        }
627        
628        {
629            let _v = serde_json::to_value(&self.force).map_err(Error::custom)?;
630            if !_v.is_null() {
631                map.insert("force".to_string(), _v);
632            }
633        }
634        
635        {
636            let _v = serde_json::to_value(&self.freeze).map_err(Error::custom)?;
637            if !_v.is_null() {
638                map.insert("freeze".to_string(), _v);
639            }
640        }
641        
642        {
643            let _v = serde_json::to_value(&self.hookscript).map_err(Error::custom)?;
644            if !_v.is_null() {
645                map.insert("hookscript".to_string(), _v);
646            }
647        }
648        
649        {
650            let _v = serde_json::to_value(&self.hotplug).map_err(Error::custom)?;
651            if !_v.is_null() {
652                map.insert("hotplug".to_string(), _v);
653            }
654        }
655        
656        {
657            let _v = serde_json::to_value(&self.hugepages).map_err(Error::custom)?;
658            if !_v.is_null() {
659                map.insert("hugepages".to_string(), _v);
660            }
661        }
662        
663        {
664            let _v = serde_json::to_value(&self.intel_tdx).map_err(Error::custom)?;
665            if !_v.is_null() {
666                map.insert("intel-tdx".to_string(), _v);
667            }
668        }
669        
670        {
671            let _v = serde_json::to_value(&self.ivshmem).map_err(Error::custom)?;
672            if !_v.is_null() {
673                map.insert("ivshmem".to_string(), _v);
674            }
675        }
676        
677        {
678            let _v = serde_json::to_value(&self.keephugepages).map_err(Error::custom)?;
679            if !_v.is_null() {
680                map.insert("keephugepages".to_string(), _v);
681            }
682        }
683        
684        {
685            let _v = serde_json::to_value(&self.keyboard).map_err(Error::custom)?;
686            if !_v.is_null() {
687                map.insert("keyboard".to_string(), _v);
688            }
689        }
690        
691        {
692            let _v = serde_json::to_value(&self.kvm).map_err(Error::custom)?;
693            if !_v.is_null() {
694                map.insert("kvm".to_string(), _v);
695            }
696        }
697        
698        {
699            let _v = serde_json::to_value(&self.localtime).map_err(Error::custom)?;
700            if !_v.is_null() {
701                map.insert("localtime".to_string(), _v);
702            }
703        }
704        
705        {
706            let _v = serde_json::to_value(&self.lock).map_err(Error::custom)?;
707            if !_v.is_null() {
708                map.insert("lock".to_string(), _v);
709            }
710        }
711        
712        {
713            let _v = serde_json::to_value(&self.machine).map_err(Error::custom)?;
714            if !_v.is_null() {
715                map.insert("machine".to_string(), _v);
716            }
717        }
718        
719        {
720            let _v = serde_json::to_value(&self.memory).map_err(Error::custom)?;
721            if !_v.is_null() {
722                map.insert("memory".to_string(), _v);
723            }
724        }
725        
726        {
727            let _v = serde_json::to_value(&self.migrate_downtime).map_err(Error::custom)?;
728            if !_v.is_null() {
729                map.insert("migrate_downtime".to_string(), _v);
730            }
731        }
732        
733        {
734            let _v = serde_json::to_value(&self.migrate_speed).map_err(Error::custom)?;
735            if !_v.is_null() {
736                map.insert("migrate_speed".to_string(), _v);
737            }
738        }
739        
740        {
741            let _v = serde_json::to_value(&self.name).map_err(Error::custom)?;
742            if !_v.is_null() {
743                map.insert("name".to_string(), _v);
744            }
745        }
746        
747        {
748            let _v = serde_json::to_value(&self.nameserver).map_err(Error::custom)?;
749            if !_v.is_null() {
750                map.insert("nameserver".to_string(), _v);
751            }
752        }
753        
754        {
755            let _v = serde_json::to_value(&self.numa).map_err(Error::custom)?;
756            if !_v.is_null() {
757                map.insert("numa".to_string(), _v);
758            }
759        }
760        
761        {
762            let _v = serde_json::to_value(&self.onboot).map_err(Error::custom)?;
763            if !_v.is_null() {
764                map.insert("onboot".to_string(), _v);
765            }
766        }
767        
768        {
769            let _v = serde_json::to_value(&self.ostype).map_err(Error::custom)?;
770            if !_v.is_null() {
771                map.insert("ostype".to_string(), _v);
772            }
773        }
774        
775        {
776            let _v = serde_json::to_value(&self.protection).map_err(Error::custom)?;
777            if !_v.is_null() {
778                map.insert("protection".to_string(), _v);
779            }
780        }
781        
782        {
783            let _v = serde_json::to_value(&self.reboot).map_err(Error::custom)?;
784            if !_v.is_null() {
785                map.insert("reboot".to_string(), _v);
786            }
787        }
788        
789        {
790            let _v = serde_json::to_value(&self.revert).map_err(Error::custom)?;
791            if !_v.is_null() {
792                map.insert("revert".to_string(), _v);
793            }
794        }
795        
796        {
797            let _v = serde_json::to_value(&self.rng0).map_err(Error::custom)?;
798            if !_v.is_null() {
799                map.insert("rng0".to_string(), _v);
800            }
801        }
802        
803        {
804            let _v = serde_json::to_value(&self.scsihw).map_err(Error::custom)?;
805            if !_v.is_null() {
806                map.insert("scsihw".to_string(), _v);
807            }
808        }
809        
810        {
811            let _v = serde_json::to_value(&self.searchdomain).map_err(Error::custom)?;
812            if !_v.is_null() {
813                map.insert("searchdomain".to_string(), _v);
814            }
815        }
816        
817        {
818            let _v = serde_json::to_value(&self.shares).map_err(Error::custom)?;
819            if !_v.is_null() {
820                map.insert("shares".to_string(), _v);
821            }
822        }
823        
824        {
825            let _v = serde_json::to_value(&self.skiplock).map_err(Error::custom)?;
826            if !_v.is_null() {
827                map.insert("skiplock".to_string(), _v);
828            }
829        }
830        
831        {
832            let _v = serde_json::to_value(&self.smbios1).map_err(Error::custom)?;
833            if !_v.is_null() {
834                map.insert("smbios1".to_string(), _v);
835            }
836        }
837        
838        {
839            let _v = serde_json::to_value(&self.smp).map_err(Error::custom)?;
840            if !_v.is_null() {
841                map.insert("smp".to_string(), _v);
842            }
843        }
844        
845        {
846            let _v = serde_json::to_value(&self.sockets).map_err(Error::custom)?;
847            if !_v.is_null() {
848                map.insert("sockets".to_string(), _v);
849            }
850        }
851        
852        {
853            let _v = serde_json::to_value(&self.spice_enhancements).map_err(Error::custom)?;
854            if !_v.is_null() {
855                map.insert("spice_enhancements".to_string(), _v);
856            }
857        }
858        
859        {
860            let _v = serde_json::to_value(&self.sshkeys).map_err(Error::custom)?;
861            if !_v.is_null() {
862                map.insert("sshkeys".to_string(), _v);
863            }
864        }
865        
866        {
867            let _v = serde_json::to_value(&self.startdate).map_err(Error::custom)?;
868            if !_v.is_null() {
869                map.insert("startdate".to_string(), _v);
870            }
871        }
872        
873        {
874            let _v = serde_json::to_value(&self.startup).map_err(Error::custom)?;
875            if !_v.is_null() {
876                map.insert("startup".to_string(), _v);
877            }
878        }
879        
880        {
881            let _v = serde_json::to_value(&self.tablet).map_err(Error::custom)?;
882            if !_v.is_null() {
883                map.insert("tablet".to_string(), _v);
884            }
885        }
886        
887        {
888            let _v = serde_json::to_value(&self.tags).map_err(Error::custom)?;
889            if !_v.is_null() {
890                map.insert("tags".to_string(), _v);
891            }
892        }
893        
894        {
895            let _v = serde_json::to_value(&self.tdf).map_err(Error::custom)?;
896            if !_v.is_null() {
897                map.insert("tdf".to_string(), _v);
898            }
899        }
900        
901        {
902            let _v = serde_json::to_value(&self.template).map_err(Error::custom)?;
903            if !_v.is_null() {
904                map.insert("template".to_string(), _v);
905            }
906        }
907        
908        {
909            let _v = serde_json::to_value(&self.tpmstate0).map_err(Error::custom)?;
910            if !_v.is_null() {
911                map.insert("tpmstate0".to_string(), _v);
912            }
913        }
914        
915        {
916            let _v = serde_json::to_value(&self.vcpus).map_err(Error::custom)?;
917            if !_v.is_null() {
918                map.insert("vcpus".to_string(), _v);
919            }
920        }
921        
922        {
923            let _v = serde_json::to_value(&self.vga).map_err(Error::custom)?;
924            if !_v.is_null() {
925                map.insert("vga".to_string(), _v);
926            }
927        }
928        
929        {
930            let _v = serde_json::to_value(&self.vmgenid).map_err(Error::custom)?;
931            if !_v.is_null() {
932                map.insert("vmgenid".to_string(), _v);
933            }
934        }
935        
936        {
937            let _v = serde_json::to_value(&self.vmstatestorage).map_err(Error::custom)?;
938            if !_v.is_null() {
939                map.insert("vmstatestorage".to_string(), _v);
940            }
941        }
942        
943        {
944            let _v = serde_json::to_value(&self.watchdog).map_err(Error::custom)?;
945            if !_v.is_null() {
946                map.insert("watchdog".to_string(), _v);
947            }
948        }
949        
950        if let Some(ref _m) = self.hostpcis {
951            for (_idx, _val) in _m.iter() {
952                map.insert(format!("hostpci{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
953            }
954        }
955        if let Some(ref _m) = self.ides {
956            for (_idx, _val) in _m.iter() {
957                map.insert(format!("ide{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
958            }
959        }
960        if let Some(ref _m) = self.ipconfigs {
961            for (_idx, _val) in _m.iter() {
962                map.insert(format!("ipconfig{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
963            }
964        }
965        if let Some(ref _m) = self.nets {
966            for (_idx, _val) in _m.iter() {
967                map.insert(format!("net{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
968            }
969        }
970        if let Some(ref _m) = self.numas {
971            for (_idx, _val) in _m.iter() {
972                map.insert(format!("numa{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
973            }
974        }
975        if let Some(ref _m) = self.parallels {
976            for (_idx, _val) in _m.iter() {
977                map.insert(format!("parallel{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
978            }
979        }
980        if let Some(ref _m) = self.satas {
981            for (_idx, _val) in _m.iter() {
982                map.insert(format!("sata{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
983            }
984        }
985        if let Some(ref _m) = self.scsis {
986            for (_idx, _val) in _m.iter() {
987                map.insert(format!("scsi{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
988            }
989        }
990        if let Some(ref _m) = self.serials {
991            for (_idx, _val) in _m.iter() {
992                map.insert(format!("serial{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
993            }
994        }
995        if let Some(ref _m) = self.unuseds {
996            for (_idx, _val) in _m.iter() {
997                map.insert(format!("unused{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
998            }
999        }
1000        if let Some(ref _m) = self.usbs {
1001            for (_idx, _val) in _m.iter() {
1002                map.insert(format!("usb{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
1003            }
1004        }
1005        if let Some(ref _m) = self.virtiofs {
1006            for (_idx, _val) in _m.iter() {
1007                map.insert(format!("virtiofs{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
1008            }
1009        }
1010        if let Some(ref _m) = self.virtios {
1011            for (_idx, _val) in _m.iter() {
1012                map.insert(format!("virtio{}", _idx), serde_json::to_value(_val).map_err(Error::custom)?);
1013            }
1014        }
1015        serde_json::Value::Object(map).serialize(serializer)
1016    }
1017}
1018
1019impl<'de> serde::Deserialize<'de> for QemuUpdateVmRequest {
1020    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1021        use serde::de::Error;
1022        let mut raw: serde_json::Map<String, serde_json::Value> =
1023            serde::Deserialize::deserialize(deserializer)?;
1024        let mut __hostpcis: std::collections::HashMap<u32, String> = std::collections::HashMap::new();
1025        {
1026            let _prefix = "hostpci";
1027            let _keys: Vec<String> = raw.keys()
1028                .filter(|k| {
1029                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1030                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1031                    } else {
1032                        false
1033                    }
1034                })
1035                .cloned()
1036                .collect();
1037            for _key in _keys {
1038                let _suffix = _key.strip_prefix(_prefix).unwrap();
1039                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1040                let _value = raw.remove(&_key).unwrap();
1041                let _item: String = serde_json::from_value(_value).map_err(Error::custom)?;
1042                __hostpcis.insert(_idx, _item);
1043            }
1044        }
1045        let mut __ides: std::collections::HashMap<u32, models::PveIdeField> = std::collections::HashMap::new();
1046        {
1047            let _prefix = "ide";
1048            let _keys: Vec<String> = raw.keys()
1049                .filter(|k| {
1050                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1051                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1052                    } else {
1053                        false
1054                    }
1055                })
1056                .cloned()
1057                .collect();
1058            for _key in _keys {
1059                let _suffix = _key.strip_prefix(_prefix).unwrap();
1060                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1061                let _value = raw.remove(&_key).unwrap();
1062                let _item: models::PveIdeField = serde_json::from_value(_value).map_err(Error::custom)?;
1063                __ides.insert(_idx, _item);
1064            }
1065        }
1066        let mut __ipconfigs: std::collections::HashMap<u32, String> = std::collections::HashMap::new();
1067        {
1068            let _prefix = "ipconfig";
1069            let _keys: Vec<String> = raw.keys()
1070                .filter(|k| {
1071                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1072                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1073                    } else {
1074                        false
1075                    }
1076                })
1077                .cloned()
1078                .collect();
1079            for _key in _keys {
1080                let _suffix = _key.strip_prefix(_prefix).unwrap();
1081                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1082                let _value = raw.remove(&_key).unwrap();
1083                let _item: String = serde_json::from_value(_value).map_err(Error::custom)?;
1084                __ipconfigs.insert(_idx, _item);
1085            }
1086        }
1087        let mut __nets: std::collections::HashMap<u32, models::PveQemuNetField> = std::collections::HashMap::new();
1088        {
1089            let _prefix = "net";
1090            let _keys: Vec<String> = raw.keys()
1091                .filter(|k| {
1092                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1093                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1094                    } else {
1095                        false
1096                    }
1097                })
1098                .cloned()
1099                .collect();
1100            for _key in _keys {
1101                let _suffix = _key.strip_prefix(_prefix).unwrap();
1102                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1103                let _value = raw.remove(&_key).unwrap();
1104                let _item: models::PveQemuNetField = serde_json::from_value(_value).map_err(Error::custom)?;
1105                __nets.insert(_idx, _item);
1106            }
1107        }
1108        let mut __numas: std::collections::HashMap<u32, models::PveNumaField> = std::collections::HashMap::new();
1109        {
1110            let _prefix = "numa";
1111            let _keys: Vec<String> = raw.keys()
1112                .filter(|k| {
1113                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1114                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1115                    } else {
1116                        false
1117                    }
1118                })
1119                .cloned()
1120                .collect();
1121            for _key in _keys {
1122                let _suffix = _key.strip_prefix(_prefix).unwrap();
1123                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1124                let _value = raw.remove(&_key).unwrap();
1125                let _item: models::PveNumaField = serde_json::from_value(_value).map_err(Error::custom)?;
1126                __numas.insert(_idx, _item);
1127            }
1128        }
1129        let mut __parallels: std::collections::HashMap<u32, String> = std::collections::HashMap::new();
1130        {
1131            let _prefix = "parallel";
1132            let _keys: Vec<String> = raw.keys()
1133                .filter(|k| {
1134                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1135                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1136                    } else {
1137                        false
1138                    }
1139                })
1140                .cloned()
1141                .collect();
1142            for _key in _keys {
1143                let _suffix = _key.strip_prefix(_prefix).unwrap();
1144                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1145                let _value = raw.remove(&_key).unwrap();
1146                let _item: String = serde_json::from_value(_value).map_err(Error::custom)?;
1147                __parallels.insert(_idx, _item);
1148            }
1149        }
1150        let mut __satas: std::collections::HashMap<u32, models::PveSataField> = std::collections::HashMap::new();
1151        {
1152            let _prefix = "sata";
1153            let _keys: Vec<String> = raw.keys()
1154                .filter(|k| {
1155                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1156                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1157                    } else {
1158                        false
1159                    }
1160                })
1161                .cloned()
1162                .collect();
1163            for _key in _keys {
1164                let _suffix = _key.strip_prefix(_prefix).unwrap();
1165                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1166                let _value = raw.remove(&_key).unwrap();
1167                let _item: models::PveSataField = serde_json::from_value(_value).map_err(Error::custom)?;
1168                __satas.insert(_idx, _item);
1169            }
1170        }
1171        let mut __scsis: std::collections::HashMap<u32, models::PveScsiField> = std::collections::HashMap::new();
1172        {
1173            let _prefix = "scsi";
1174            let _keys: Vec<String> = raw.keys()
1175                .filter(|k| {
1176                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1177                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1178                    } else {
1179                        false
1180                    }
1181                })
1182                .cloned()
1183                .collect();
1184            for _key in _keys {
1185                let _suffix = _key.strip_prefix(_prefix).unwrap();
1186                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1187                let _value = raw.remove(&_key).unwrap();
1188                let _item: models::PveScsiField = serde_json::from_value(_value).map_err(Error::custom)?;
1189                __scsis.insert(_idx, _item);
1190            }
1191        }
1192        let mut __serials: std::collections::HashMap<u32, String> = std::collections::HashMap::new();
1193        {
1194            let _prefix = "serial";
1195            let _keys: Vec<String> = raw.keys()
1196                .filter(|k| {
1197                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1198                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1199                    } else {
1200                        false
1201                    }
1202                })
1203                .cloned()
1204                .collect();
1205            for _key in _keys {
1206                let _suffix = _key.strip_prefix(_prefix).unwrap();
1207                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1208                let _value = raw.remove(&_key).unwrap();
1209                let _item: String = serde_json::from_value(_value).map_err(Error::custom)?;
1210                __serials.insert(_idx, _item);
1211            }
1212        }
1213        let mut __unuseds: std::collections::HashMap<u32, models::PveQemuUnusedField> = std::collections::HashMap::new();
1214        {
1215            let _prefix = "unused";
1216            let _keys: Vec<String> = raw.keys()
1217                .filter(|k| {
1218                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1219                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1220                    } else {
1221                        false
1222                    }
1223                })
1224                .cloned()
1225                .collect();
1226            for _key in _keys {
1227                let _suffix = _key.strip_prefix(_prefix).unwrap();
1228                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1229                let _value = raw.remove(&_key).unwrap();
1230                let _item: models::PveQemuUnusedField = serde_json::from_value(_value).map_err(Error::custom)?;
1231                __unuseds.insert(_idx, _item);
1232            }
1233        }
1234        let mut __usbs: std::collections::HashMap<u32, models::PveUsbField> = std::collections::HashMap::new();
1235        {
1236            let _prefix = "usb";
1237            let _keys: Vec<String> = raw.keys()
1238                .filter(|k| {
1239                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1240                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1241                    } else {
1242                        false
1243                    }
1244                })
1245                .cloned()
1246                .collect();
1247            for _key in _keys {
1248                let _suffix = _key.strip_prefix(_prefix).unwrap();
1249                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1250                let _value = raw.remove(&_key).unwrap();
1251                let _item: models::PveUsbField = serde_json::from_value(_value).map_err(Error::custom)?;
1252                __usbs.insert(_idx, _item);
1253            }
1254        }
1255        let mut __virtiofs: std::collections::HashMap<u32, models::PveVirtiofsField> = std::collections::HashMap::new();
1256        {
1257            let _prefix = "virtiofs";
1258            let _keys: Vec<String> = raw.keys()
1259                .filter(|k| {
1260                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1261                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1262                    } else {
1263                        false
1264                    }
1265                })
1266                .cloned()
1267                .collect();
1268            for _key in _keys {
1269                let _suffix = _key.strip_prefix(_prefix).unwrap();
1270                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1271                let _value = raw.remove(&_key).unwrap();
1272                let _item: models::PveVirtiofsField = serde_json::from_value(_value).map_err(Error::custom)?;
1273                __virtiofs.insert(_idx, _item);
1274            }
1275        }
1276        let mut __virtios: std::collections::HashMap<u32, models::PveVirtioField> = std::collections::HashMap::new();
1277        {
1278            let _prefix = "virtio";
1279            let _keys: Vec<String> = raw.keys()
1280                .filter(|k| {
1281                    if let Some(_suffix) = k.strip_prefix(_prefix) {
1282                        !_suffix.is_empty() && _suffix.chars().all(|c| c.is_ascii_digit())
1283                    } else {
1284                        false
1285                    }
1286                })
1287                .cloned()
1288                .collect();
1289            for _key in _keys {
1290                let _suffix = _key.strip_prefix(_prefix).unwrap();
1291                let _idx: u32 = _suffix.parse().map_err(Error::custom)?;
1292                let _value = raw.remove(&_key).unwrap();
1293                let _item: models::PveVirtioField = serde_json::from_value(_value).map_err(Error::custom)?;
1294                __virtios.insert(_idx, _item);
1295            }
1296        }
1297        Ok(QemuUpdateVmRequest {
1298            
1299            acpi: serde_json::from_value(raw.remove("acpi").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1300            
1301            affinity: serde_json::from_value(raw.remove("affinity").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1302            
1303            agent: serde_json::from_value(raw.remove("agent").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1304            
1305            allow_ksm: serde_json::from_value(raw.remove("allow-ksm").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1306            
1307            amd_sev: serde_json::from_value(raw.remove("amd-sev").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1308            
1309            arch: serde_json::from_value(raw.remove("arch").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1310            
1311            args: serde_json::from_value(raw.remove("args").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1312            
1313            audio0: serde_json::from_value(raw.remove("audio0").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1314            
1315            autostart: serde_json::from_value(raw.remove("autostart").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1316            
1317            balloon: serde_json::from_value(raw.remove("balloon").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1318            
1319            bios: serde_json::from_value(raw.remove("bios").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1320            
1321            boot: serde_json::from_value(raw.remove("boot").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1322            
1323            bootdisk: serde_json::from_value(raw.remove("bootdisk").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1324            
1325            cdrom: serde_json::from_value(raw.remove("cdrom").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1326            
1327            cicustom: serde_json::from_value(raw.remove("cicustom").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1328            
1329            cipassword: serde_json::from_value(raw.remove("cipassword").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1330            
1331            citype: serde_json::from_value(raw.remove("citype").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1332            
1333            ciupgrade: serde_json::from_value(raw.remove("ciupgrade").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1334            
1335            ciuser: serde_json::from_value(raw.remove("ciuser").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1336            
1337            cores: serde_json::from_value(raw.remove("cores").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1338            
1339            cpu: serde_json::from_value(raw.remove("cpu").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1340            
1341            cpulimit: serde_json::from_value(raw.remove("cpulimit").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1342            
1343            cpuunits: serde_json::from_value(raw.remove("cpuunits").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1344            
1345            delete: serde_json::from_value(raw.remove("delete").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1346            
1347            description: serde_json::from_value(raw.remove("description").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1348            
1349            digest: serde_json::from_value(raw.remove("digest").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1350            
1351            efidisk0: serde_json::from_value(raw.remove("efidisk0").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1352            
1353            force: serde_json::from_value(raw.remove("force").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1354            
1355            freeze: serde_json::from_value(raw.remove("freeze").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1356            
1357            hookscript: serde_json::from_value(raw.remove("hookscript").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1358            
1359            hotplug: serde_json::from_value(raw.remove("hotplug").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1360            
1361            hugepages: serde_json::from_value(raw.remove("hugepages").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1362            
1363            intel_tdx: serde_json::from_value(raw.remove("intel-tdx").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1364            
1365            ivshmem: serde_json::from_value(raw.remove("ivshmem").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1366            
1367            keephugepages: serde_json::from_value(raw.remove("keephugepages").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1368            
1369            keyboard: serde_json::from_value(raw.remove("keyboard").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1370            
1371            kvm: serde_json::from_value(raw.remove("kvm").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1372            
1373            localtime: serde_json::from_value(raw.remove("localtime").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1374            
1375            lock: serde_json::from_value(raw.remove("lock").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1376            
1377            machine: serde_json::from_value(raw.remove("machine").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1378            
1379            memory: serde_json::from_value(raw.remove("memory").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1380            
1381            migrate_downtime: serde_json::from_value(raw.remove("migrate_downtime").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1382            
1383            migrate_speed: serde_json::from_value(raw.remove("migrate_speed").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1384            
1385            name: serde_json::from_value(raw.remove("name").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1386            
1387            nameserver: serde_json::from_value(raw.remove("nameserver").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1388            
1389            numa: serde_json::from_value(raw.remove("numa").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1390            
1391            onboot: serde_json::from_value(raw.remove("onboot").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1392            
1393            ostype: serde_json::from_value(raw.remove("ostype").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1394            
1395            protection: serde_json::from_value(raw.remove("protection").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1396            
1397            reboot: serde_json::from_value(raw.remove("reboot").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1398            
1399            revert: serde_json::from_value(raw.remove("revert").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1400            
1401            rng0: serde_json::from_value(raw.remove("rng0").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1402            
1403            scsihw: serde_json::from_value(raw.remove("scsihw").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1404            
1405            searchdomain: serde_json::from_value(raw.remove("searchdomain").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1406            
1407            shares: serde_json::from_value(raw.remove("shares").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1408            
1409            skiplock: serde_json::from_value(raw.remove("skiplock").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1410            
1411            smbios1: serde_json::from_value(raw.remove("smbios1").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1412            
1413            smp: serde_json::from_value(raw.remove("smp").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1414            
1415            sockets: serde_json::from_value(raw.remove("sockets").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1416            
1417            spice_enhancements: serde_json::from_value(raw.remove("spice_enhancements").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1418            
1419            sshkeys: serde_json::from_value(raw.remove("sshkeys").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1420            
1421            startdate: serde_json::from_value(raw.remove("startdate").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1422            
1423            startup: serde_json::from_value(raw.remove("startup").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1424            
1425            tablet: serde_json::from_value(raw.remove("tablet").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1426            
1427            tags: serde_json::from_value(raw.remove("tags").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1428            
1429            tdf: serde_json::from_value(raw.remove("tdf").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1430            
1431            template: serde_json::from_value(raw.remove("template").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1432            
1433            tpmstate0: serde_json::from_value(raw.remove("tpmstate0").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1434            
1435            vcpus: serde_json::from_value(raw.remove("vcpus").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1436            
1437            vga: serde_json::from_value(raw.remove("vga").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1438            
1439            vmgenid: serde_json::from_value(raw.remove("vmgenid").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1440            
1441            vmstatestorage: serde_json::from_value(raw.remove("vmstatestorage").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1442            
1443            watchdog: serde_json::from_value(raw.remove("watchdog").unwrap_or(serde_json::Value::Null)).map_err(Error::custom)?,
1444            
1445            hostpcis: if __hostpcis.is_empty() { None } else { Some(__hostpcis) },
1446            ides: if __ides.is_empty() { None } else { Some(__ides) },
1447            ipconfigs: if __ipconfigs.is_empty() { None } else { Some(__ipconfigs) },
1448            nets: if __nets.is_empty() { None } else { Some(__nets) },
1449            numas: if __numas.is_empty() { None } else { Some(__numas) },
1450            parallels: if __parallels.is_empty() { None } else { Some(__parallels) },
1451            satas: if __satas.is_empty() { None } else { Some(__satas) },
1452            scsis: if __scsis.is_empty() { None } else { Some(__scsis) },
1453            serials: if __serials.is_empty() { None } else { Some(__serials) },
1454            unuseds: if __unuseds.is_empty() { None } else { Some(__unuseds) },
1455            usbs: if __usbs.is_empty() { None } else { Some(__usbs) },
1456            virtiofs: if __virtiofs.is_empty() { None } else { Some(__virtiofs) },
1457            virtios: if __virtios.is_empty() { None } else { Some(__virtios) },
1458        })
1459    }
1460}
1461
1462