1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
pub mod agent;
pub mod clone;
pub mod cloudinit;
pub mod config;
pub mod feature;
pub mod firewall;
pub mod migrate;
pub mod monitor;
pub mod move_disk;
pub mod mtunnel;
pub mod mtunnelwebsocket;
pub mod pending;
pub mod remote_migrate;
pub mod resize;
pub mod rrd;
pub mod rrddata;
pub mod sendkey;
pub mod snapshot;
pub mod spiceproxy;
pub mod status;
pub mod template;
pub mod termproxy;
pub mod unlink;
pub mod vncproxy;
pub mod vncwebsocket;
pub struct VmidClient<T> {
    client: T,
    path: String,
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn new(client: T, parent_path: &str, vmid: crate::types::VmId) -> Self {
        Self {
            client,
            path: format!("{}/{}", parent_path, vmid),
        }
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    #[doc = "Destroy the VM and  all used/owned volumes. Removes any VM specific permissions and firewall rules"]
    pub fn delete(&self, params: DeleteParams) -> Result<String, T::Error> {
        let path = self.path.to_string();
        self.client.delete(&path, &params)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    #[doc = "Directory index"]
    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
        let path = self.path.to_string();
        self.client.get(&path, &())
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
pub struct DeleteParams {
    #[serde(rename = "destroy-unreferenced-disks")]
    #[serde(
        serialize_with = "crate::types::serialize_bool_optional",
        deserialize_with = "crate::types::deserialize_bool_optional"
    )]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "If set, destroy additionally all disks not referenced in the config but with a matching VMID from all enabled storages."]
    pub destroy_unreferenced_disks: Option<bool>,
    #[serde(
        serialize_with = "crate::types::serialize_bool_optional",
        deserialize_with = "crate::types::deserialize_bool_optional"
    )]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "Remove VMID from configurations, like backup & replication jobs and HA."]
    pub purge: Option<bool>,
    #[serde(
        serialize_with = "crate::types::serialize_bool_optional",
        deserialize_with = "crate::types::deserialize_bool_optional"
    )]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    #[doc = "Ignore locks - only root is allowed to use this option."]
    pub skiplock: Option<bool>,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl GetOutputItems {
    pub fn new(subdir: String) -> Self {
        Self {
            subdir,
            additional_properties: Default::default(),
        }
    }
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct GetOutputItems {
    pub subdir: String,
    #[serde(
        flatten,
        default,
        skip_serializing_if = "::std::collections::HashMap::is_empty"
    )]
    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn firewall(&self) -> firewall::FirewallClient<T> {
        firewall::FirewallClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn agent(&self) -> agent::AgentClient<T> {
        agent::AgentClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn rrd(&self) -> rrd::RrdClient<T> {
        rrd::RrdClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn rrddata(&self) -> rrddata::RrddataClient<T> {
        rrddata::RrddataClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn config(&self) -> config::ConfigClient<T> {
        config::ConfigClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn pending(&self) -> pending::PendingClient<T> {
        pending::PendingClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn cloudinit(&self) -> cloudinit::CloudinitClient<T> {
        cloudinit::CloudinitClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn unlink(&self) -> unlink::UnlinkClient<T> {
        unlink::UnlinkClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn vncproxy(&self) -> vncproxy::VncproxyClient<T> {
        vncproxy::VncproxyClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn termproxy(&self) -> termproxy::TermproxyClient<T> {
        termproxy::TermproxyClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn vncwebsocket(&self) -> vncwebsocket::VncwebsocketClient<T> {
        vncwebsocket::VncwebsocketClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn spiceproxy(&self) -> spiceproxy::SpiceproxyClient<T> {
        spiceproxy::SpiceproxyClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn status(&self) -> status::StatusClient<T> {
        status::StatusClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn sendkey(&self) -> sendkey::SendkeyClient<T> {
        sendkey::SendkeyClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn feature(&self) -> feature::FeatureClient<T> {
        feature::FeatureClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn clone(&self) -> clone::CloneClient<T> {
        clone::CloneClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn move_disk(&self) -> move_disk::MoveDiskClient<T> {
        move_disk::MoveDiskClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn migrate(&self) -> migrate::MigrateClient<T> {
        migrate::MigrateClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn remote_migrate(&self) -> remote_migrate::RemoteMigrateClient<T> {
        remote_migrate::RemoteMigrateClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn monitor(&self) -> monitor::MonitorClient<T> {
        monitor::MonitorClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn resize(&self) -> resize::ResizeClient<T> {
        resize::ResizeClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn snapshot(&self) -> snapshot::SnapshotClient<T> {
        snapshot::SnapshotClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn template(&self) -> template::TemplateClient<T> {
        template::TemplateClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn mtunnel(&self) -> mtunnel::MtunnelClient<T> {
        mtunnel::MtunnelClient::<T>::new(self.client.clone(), &self.path)
    }
}
impl<T> VmidClient<T>
where
    T: crate::client::Client,
{
    pub fn mtunnelwebsocket(&self) -> mtunnelwebsocket::MtunnelwebsocketClient<T> {
        mtunnelwebsocket::MtunnelwebsocketClient::<T>::new(self.client.clone(), &self.path)
    }
}