vim_rs 0.4.4

Rust Bindings for the VMware by Broadcom vCenter VI JSON API
Documentation
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// The managed object provides support for vSAN remote datastore management
/// operations.
/// 
/// It can be accessed with MOID of 'vsan-remote-datastore-system',
/// through vSAN service at vCenter server side.
#[derive(Clone)]
pub struct VsanRemoteDatastoreSystem {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl VsanRemoteDatastoreSystem {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// Create a new Datastore Source.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    ///
    /// ## Parameters:
    ///
    /// ### datastore_source
    /// The information of the Datastore Source to be
    /// created. If the vCenter is an ELM linked vCenter, only
    /// *VsanRemoteVcInfo.vcHost*
    /// needs to be specified. For a standalone vCenter, the
    /// *VsanRemoteVcInfoStandalone.user* and
    /// *VsanRemoteVcInfoStandalone.password*
    /// needs to be specified for an user credential with
    /// the privileges to create the service account.
    ///
    /// ## Returns:
    ///
    /// The task for creating Datastore Source operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***AlreadyExists***: if the Datastore Source being created has existed.
    /// 
    /// ***VsanSslVerifyCertFault***: SSL verification fault for remote vCenter
    /// such as certificate not verified.
    /// 
    /// ***VsanFault***: Other vSAN related faults.
    pub async fn vsan_create_datastore_source(&self, datastore_source: &crate::types::structs::VsanHciMeshDatastoreSource) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanCreateDatastoreSourceRequestType {datastore_source, };
        let bytes = self.client.invoke("vsan", "VsanRemoteDatastoreSystem", &self.mo_id, "VsanCreateDatastoreSource", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Destroy an existing Datastore Source configuration.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    ///
    /// ## Parameters:
    ///
    /// ### datastore_source
    /// The Datastore Source to be destroyed. If the vCenter
    /// is an ELM linked vCenter, only
    /// *VsanRemoteVcInfo.vcHost*
    /// needs to be specified. For a standalone vCenter, the
    /// *VsanRemoteVcInfoStandalone.user* and
    /// *VsanRemoteVcInfoStandalone.password*
    /// needs to be specified for an user credential with
    /// the privileges to delete the service account.
    ///
    /// ## Returns:
    ///
    /// The task for destroying Datastore Source operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: The specified Datastore Source is not found.
    /// 
    /// ***ResourceInUse***: The specified Datastore Source still has datastores
    /// being mounted.
    /// 
    /// ***VsanFault***: Other vSAN related faults.
    pub async fn vsan_destroy_datastore_source(&self, datastore_source: &crate::types::structs::VsanHciMeshDatastoreSource) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanDestroyDatastoreSourceRequestType {datastore_source, };
        let bytes = self.client.invoke("vsan", "VsanRemoteDatastoreSystem", &self.mo_id, "VsanDestroyDatastoreSource", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Checks mount compatibility of a vSAN datastore with given vSAN cluster.
    /// 
    /// Get mount pre-check results of a client cluster and remote
    /// vSAN datastore. Different types of checks are needed, see
    /// *VsanMountPrecheckResult* for details.
    ///
    /// ## Parameters:
    ///
    /// ### cluster
    /// Client cluster that triggers the mount precheck request.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ### datastore
    /// The server vSAN datastore to be checked for mount.
    /// 
    /// Refers instance of *Datastore*.
    ///
    /// ### server_cluster_info
    /// The server cluster information of the vSAN
    /// datastore to be checked for mount. It's used
    /// for stretched cluster and remote
    /// data-in-transit configuration check.
    ///
    /// ## Returns:
    ///
    /// Pre-check results of a client cluster mounting server vSAN datastore.
    pub async fn mount_precheck(&self, cluster: &crate::types::structs::ManagedObjectReference, datastore: &crate::types::structs::ManagedObjectReference, server_cluster_info: Option<&crate::types::structs::VcRemoteVsanServerClusterInfo>) -> Result<Box<dyn crate::types::traits::VsanMountPrecheckResultTrait>> {
        let input = MountPrecheckRequestType {cluster, datastore, server_cluster_info, };
        let bytes = self.client.invoke("vsan", "VsanRemoteDatastoreSystem", &self.mo_id, "MountPrecheck", Some(&input)).await?;
        let result: Box<dyn crate::types::traits::VsanMountPrecheckResultTrait> = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Run prechecks for a Datastore Source.
    /// 
    /// This can be used before creating,
    /// updating, destroying a Datastore Source or other places needing to verify
    /// a Datastore Source.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    ///
    /// ## Parameters:
    ///
    /// ### datastore_source
    /// The information of the Datastore Source to be
    /// prechecked.
    ///
    /// ### operation
    /// The hint of the operation which the precheck is performed
    /// against, see
    /// *PrecheckDatastoreSourceOperation_enum*.
    ///
    /// ## Returns:
    ///
    /// Pre-check results of the specified Datastore Source.
    ///
    /// ## Errors:
    ///
    /// ***VsanSslVerifyCertFault***: SSL verification fault for remote vCenter
    /// such as certificate not verified.
    /// 
    /// ***VsanFault***: Other vSAN related faults.
    pub async fn vsan_precheck_datastore_source(&self, datastore_source: &crate::types::structs::VsanHciMeshDatastoreSource, operation: Option<&str>) -> Result<crate::types::structs::VsanDatastoreSourcePrecheckResult> {
        let input = VsanPrecheckDatastoreSourceRequestType {datastore_source, operation, };
        let bytes = self.client.invoke("vsan", "VsanRemoteDatastoreSystem", &self.mo_id, "VsanPrecheckDatastoreSource", Some(&input)).await?;
        let result: crate::types::structs::VsanDatastoreSourcePrecheckResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Query Datastore Source information for specified remote vCenters.
    /// 
    /// If no vCenter is specified, all Datastore Sources configured are returned.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Parameters:
    ///
    /// ### vc_hosts
    /// The names (e.g. FQDNs) of the remote vCenters to be queried.
    /// Only those names configured through
    /// *VsanRemoteDatastoreSystem.VsanCreateDatastoreSource*
    /// are valid to be used.
    ///
    /// ## Returns:
    ///
    /// The Datastore Sources information queried.
    ///
    /// ## Errors:
    ///
    /// ***VsanFault***: vSAN related faults.
    pub async fn vsan_query_datastore_source(&self, vc_hosts: Option<&[String]>) -> Result<Option<Vec<crate::types::structs::VsanHciMeshDatastoreSource>>> {
        let input = VsanQueryDatastoreSourceRequestType {vc_hosts, };
        let bytes_opt = self.client.invoke_optional("vsan", "VsanRemoteDatastoreSystem", &self.mo_id, "VsanQueryDatastoreSource", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// This method takes a list of VsanXvcQuerySpec, then returns a list of
    /// VsanXvcQueryResultSet.
    /// 
    /// Each element of returned VsanXvcQueryResultSet
    /// list maps to the query spec in the VsanXvcQuerySpec list by index.
    /// Caller can provide a proper VsanXvcQuerySpec, and specify the required
    /// properties to be returned. The full list of the properties for each kind
    /// of returned object is described in VsanXvcQueryResultSet.
    /// Optionally, user can provide a list of remote VCs' information
    /// *VsanRemoteVcInfo* to specify the remote VC to query.
    /// The supported objects are listed in
    /// *VsanXvcQuerySpec.objectModel*.
    /// Each item is one datastore's info mapping to the specified properties
    /// *VsanXvcQuerySpec.properties* in spec.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Parameters:
    ///
    /// ### query_specs
    /// The spec information to specify what to be queried.
    ///
    /// ### extra_vc_infos
    /// The remote vCenter information for communication if
    /// caller needs to explicitly specify a remote vCenter
    /// as a provider vCenter which is not configured as a
    /// Datastore Source configuration. The user credential
    /// needs to be provided in the remote vCenter
    /// information, e.g., use
    /// *VsanRemoteVcInfoStandalone*.
    ///
    /// ## Returns:
    ///
    /// The query result information per the query specs.
    ///
    /// ## Errors:
    ///
    /// ***VsanFault***: vSAN related faults.
    pub async fn vsan_query_hci_mesh_datastores(&self, query_specs: Option<&[crate::types::structs::VsanXvcQuerySpec]>, extra_vc_infos: Option<&[Box<dyn crate::types::traits::VsanRemoteVcInfoTrait>]>) -> Result<Option<Vec<crate::types::structs::VsanXvcQueryResultSet>>> {
        let input = VsanQueryHciMeshDatastoresRequestType {query_specs, extra_vc_infos, };
        let bytes_opt = self.client.invoke_optional("vsan", "VsanRemoteDatastoreSystem", &self.mo_id, "VsanQueryHciMeshDatastores", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Checks mount compatibility of a cross VC vSAN datastore with given vSAN
    /// cluster.
    /// 
    /// Get mount pre-check results of a client cluster and cross VC remote
    /// vSAN datastore. Different types of checks are needed, see
    /// *VsanMountPrecheckResult* for details.
    ///
    /// ## Parameters:
    ///
    /// ### cluster
    /// Client cluster that trigger the mount precheck request.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ### xvc_datastore
    /// -
    ///
    /// ## Returns:
    ///
    /// Pre-check results of a client cluster mounting cross VC vSAN datastore.
    ///
    /// ## Errors:
    ///
    /// ***VsanFault***: vSAN related faults.
    pub async fn remote_vc_mount_precheck(&self, cluster: &crate::types::structs::ManagedObjectReference, xvc_datastore: &crate::types::structs::VsanXvcDatastoreInfo) -> Result<Box<dyn crate::types::traits::VsanMountPrecheckResultTrait>> {
        let input = RemoteVcMountPrecheckRequestType {cluster, xvc_datastore, };
        let bytes = self.client.invoke("vsan", "VsanRemoteDatastoreSystem", &self.mo_id, "RemoteVcMountPrecheck", Some(&input)).await?;
        let result: Box<dyn crate::types::traits::VsanMountPrecheckResultTrait> = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Update the configuration of an existing Datastore Source.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    ///
    /// ## Parameters:
    ///
    /// ### datastore_source
    /// The information of the Datastore Source to be
    /// updated. The updated Datastore Source is
    /// identified by the vcHost specified in the
    /// remote vCenter info of this param.
    /// If the original or updated vCenter is a standalone
    /// vCenter, the
    /// *VsanRemoteVcInfoStandalone.user* and
    /// *VsanRemoteVcInfoStandalone.password*
    /// needs to be specified for an user credential with
    /// the privilege to update the service account.
    /// If both original and updated vCenters are ELM
    /// vCenters only *VsanRemoteVcInfo.vcHost*
    /// needs to be specified.
    ///
    /// ## Returns:
    ///
    /// The task for updating Datastore Source operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: The specified Datastore Source is not found.
    /// 
    /// ***VsanFault***: Other vSAN related faults.
    pub async fn vsan_update_datastore_source(&self, datastore_source: &crate::types::structs::VsanHciMeshDatastoreSource) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanUpdateDatastoreSourceRequestType {datastore_source, };
        let bytes = self.client.invoke("vsan", "VsanRemoteDatastoreSystem", &self.mo_id, "VsanUpdateDatastoreSource", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
}
struct VsanCreateDatastoreSourceRequestType<'a> {
    datastore_source: &'a crate::types::structs::VsanHciMeshDatastoreSource,
}

impl<'a> miniserde::Serialize for VsanCreateDatastoreSourceRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(VsanCreateDatastoreSourceRequestTypeSer { data: self, seq: 0 }))
    }
}

struct VsanCreateDatastoreSourceRequestTypeSer<'b, 'a> {
    data: &'b VsanCreateDatastoreSourceRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanCreateDatastoreSourceRequestTypeSer<'b, 'a> {
    fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
        let seq = self.seq;
        self.seq += 1;
        match seq {
            0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanCreateDatastoreSourceRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("datastoreSource"), &self.data.datastore_source as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct VsanDestroyDatastoreSourceRequestType<'a> {
    datastore_source: &'a crate::types::structs::VsanHciMeshDatastoreSource,
}

impl<'a> miniserde::Serialize for VsanDestroyDatastoreSourceRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(VsanDestroyDatastoreSourceRequestTypeSer { data: self, seq: 0 }))
    }
}

struct VsanDestroyDatastoreSourceRequestTypeSer<'b, 'a> {
    data: &'b VsanDestroyDatastoreSourceRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanDestroyDatastoreSourceRequestTypeSer<'b, 'a> {
    fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
        let seq = self.seq;
        self.seq += 1;
        match seq {
            0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanDestroyDatastoreSourceRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("datastoreSource"), &self.data.datastore_source as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct MountPrecheckRequestType<'a> {
    cluster: &'a crate::types::structs::ManagedObjectReference,
    datastore: &'a crate::types::structs::ManagedObjectReference,
    server_cluster_info: Option<&'a crate::types::structs::VcRemoteVsanServerClusterInfo>,
}

impl<'a> miniserde::Serialize for MountPrecheckRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(MountPrecheckRequestTypeSer { data: self, seq: 0 }))
    }
}

struct MountPrecheckRequestTypeSer<'b, 'a> {
    data: &'b MountPrecheckRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for MountPrecheckRequestTypeSer<'b, 'a> {
    fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
        loop {
            let seq = self.seq;
            self.seq += 1;
            match seq {
                0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"MountPrecheckRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("cluster"), &self.data.cluster as &dyn miniserde::Serialize)),
                2 => return Some((std::borrow::Cow::Borrowed("datastore"), &self.data.datastore as &dyn miniserde::Serialize)),
                3 => {
                    let Some(ref val) = self.data.server_cluster_info else { continue; };
                    return Some((std::borrow::Cow::Borrowed("serverClusterInfo"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanPrecheckDatastoreSourceRequestType<'a> {
    datastore_source: &'a crate::types::structs::VsanHciMeshDatastoreSource,
    operation: Option<&'a str>,
}

impl<'a> miniserde::Serialize for VsanPrecheckDatastoreSourceRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(VsanPrecheckDatastoreSourceRequestTypeSer { data: self, seq: 0 }))
    }
}

struct VsanPrecheckDatastoreSourceRequestTypeSer<'b, 'a> {
    data: &'b VsanPrecheckDatastoreSourceRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanPrecheckDatastoreSourceRequestTypeSer<'b, 'a> {
    fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
        loop {
            let seq = self.seq;
            self.seq += 1;
            match seq {
                0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanPrecheckDatastoreSourceRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("datastoreSource"), &self.data.datastore_source as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.operation else { continue; };
                    return Some((std::borrow::Cow::Borrowed("operation"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanQueryDatastoreSourceRequestType<'a> {
    vc_hosts: Option<&'a [String]>,
}

impl<'a> miniserde::Serialize for VsanQueryDatastoreSourceRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(VsanQueryDatastoreSourceRequestTypeSer { data: self, seq: 0 }))
    }
}

struct VsanQueryDatastoreSourceRequestTypeSer<'b, 'a> {
    data: &'b VsanQueryDatastoreSourceRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanQueryDatastoreSourceRequestTypeSer<'b, 'a> {
    fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
        loop {
            let seq = self.seq;
            self.seq += 1;
            match seq {
                0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanQueryDatastoreSourceRequestType")),
                1 => {
                    let Some(ref val) = self.data.vc_hosts else { continue; };
                    return Some((std::borrow::Cow::Borrowed("vcHosts"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanQueryHciMeshDatastoresRequestType<'a> {
    query_specs: Option<&'a [crate::types::structs::VsanXvcQuerySpec]>,
    extra_vc_infos: Option<&'a [Box<dyn crate::types::traits::VsanRemoteVcInfoTrait>]>,
}

impl<'a> miniserde::Serialize for VsanQueryHciMeshDatastoresRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(VsanQueryHciMeshDatastoresRequestTypeSer { data: self, seq: 0 }))
    }
}

struct VsanQueryHciMeshDatastoresRequestTypeSer<'b, 'a> {
    data: &'b VsanQueryHciMeshDatastoresRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanQueryHciMeshDatastoresRequestTypeSer<'b, 'a> {
    fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
        loop {
            let seq = self.seq;
            self.seq += 1;
            match seq {
                0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanQueryHciMeshDatastoresRequestType")),
                1 => {
                    let Some(ref val) = self.data.query_specs else { continue; };
                    return Some((std::borrow::Cow::Borrowed("querySpecs"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.extra_vc_infos else { continue; };
                    return Some((std::borrow::Cow::Borrowed("extraVcInfos"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct RemoteVcMountPrecheckRequestType<'a> {
    cluster: &'a crate::types::structs::ManagedObjectReference,
    xvc_datastore: &'a crate::types::structs::VsanXvcDatastoreInfo,
}

impl<'a> miniserde::Serialize for RemoteVcMountPrecheckRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(RemoteVcMountPrecheckRequestTypeSer { data: self, seq: 0 }))
    }
}

struct RemoteVcMountPrecheckRequestTypeSer<'b, 'a> {
    data: &'b RemoteVcMountPrecheckRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RemoteVcMountPrecheckRequestTypeSer<'b, 'a> {
    fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
        let seq = self.seq;
        self.seq += 1;
        match seq {
            0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"RemoteVcMountPrecheckRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("cluster"), &self.data.cluster as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("xvcDatastore"), &self.data.xvc_datastore as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct VsanUpdateDatastoreSourceRequestType<'a> {
    datastore_source: &'a crate::types::structs::VsanHciMeshDatastoreSource,
}

impl<'a> miniserde::Serialize for VsanUpdateDatastoreSourceRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(VsanUpdateDatastoreSourceRequestTypeSer { data: self, seq: 0 }))
    }
}

struct VsanUpdateDatastoreSourceRequestTypeSer<'b, 'a> {
    data: &'b VsanUpdateDatastoreSourceRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanUpdateDatastoreSourceRequestTypeSer<'b, 'a> {
    fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
        let seq = self.seq;
        self.seq += 1;
        match seq {
            0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"VsanUpdateDatastoreSourceRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("datastoreSource"), &self.data.datastore_source as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}