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
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// This managed object type provides a way to configure resource usage for
/// storage resources.
#[derive(Clone)]
pub struct StorageResourceManager {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl StorageResourceManager {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// Deprecated as of vSphere8.0 U3, and there is no replacement for it.
    /// 
    /// Changes configuration of storage I/O resource management for a given datastore.
    /// 
    /// The changes are applied to all the backing storage devices for the datastore.
    /// Currently we only support storage I/O resource management on VMFS volumes.
    /// In order to enable storage I/O resource management on a datstore, we require
    /// that all the hosts that are attached to the datastore support this feature.
    /// The privilege Datastore.ConfigIOManagement is required on the target
    /// datastore.
    /// 
    /// This method is only supported by vCenter server.
    ///
    /// ## Parameters:
    ///
    /// ### datastore
    /// The datastore to be configured.
    /// 
    /// Refers instance of *Datastore*.
    ///
    /// ### spec
    /// The configuration spec.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to
    /// monitor the operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***NotSupported***: if called directly on a host or if called on a datastore
    /// that does not have VMFS Volume.
    /// 
    /// ***InvalidArgument***: if
    /// 1\. IORMConfigSpec.congestionThreshold is not within the
    /// desired range (5 to 100 milliseconds).
    /// 2\. IORMConfigSpec.congestionThresholdMode is not specified and
    /// IORMConfigSpec.congestionThreshold is specified. To set
    /// congestionThreshold, congestionThresholdMode should be set to
    /// manual
    /// 
    /// ***IORMNotSupportedHostOnDatastore***: if called on a datastore that is
    /// connected to a host that does not support storage I/O resource
    /// management.
    /// 
    /// ***InaccessibleDatastore***: if cannot access the datastore from any of the
    /// hosts.
    pub async fn configure_datastore_iorm_task(&self, datastore: &crate::types::structs::ManagedObjectReference, spec: &crate::types::structs::StorageIormConfigSpec) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ConfigureDatastoreIormRequestType {datastore, spec, };
        let bytes = self.client.invoke("", "StorageResourceManager", &self.mo_id, "ConfigureDatastoreIORM_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of vSphere8.0 U3, and there is no replacement for it.
    /// 
    /// Query configuration options for storage I/O resource management.
    /// 
    /// ***Required privileges:*** Datastore.Config
    ///
    /// ## Parameters:
    ///
    /// ### host
    /// \[in\] - The host VC will forward the query
    /// to. This parameter is ignored by host if this method is
    /// called on a host directly.
    /// 
    /// Refers instance of *HostSystem*.
    ///
    /// ## Returns:
    ///
    /// configuration option object.
    pub async fn query_iorm_config_option(&self, host: &crate::types::structs::ManagedObjectReference) -> Result<crate::types::structs::StorageIormConfigOption> {
        let input = QueryIormConfigOptionRequestType {host, };
        let bytes = self.client.invoke("", "StorageResourceManager", &self.mo_id, "QueryIORMConfigOption", Some(&input)).await?;
        let result: crate::types::structs::StorageIormConfigOption = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Applies a recommendation from the recommendation list that is generated
    /// by SDRS initial placement invoked by RecommendDatastore method.
    /// 
    /// In the case of CreateVm and CloneVm a VirtualMachine is returned. Other
    /// workflows don't have a return value.
    /// 
    /// Requires Resource. ApplyRecommendation privilege on the storage pod.
    /// Additionally, depending on the workflow where this API is called from,
    /// it may require the privileges of invoking one of following APIs:
    /// - CreateVm *Folder.CreateVM_Task*
    /// - AddDisk *VirtualMachine.ReconfigVM_Task*
    /// - RelocateVm *VirtualMachine.RelocateVM_Task*
    /// - CloneVm *VirtualMachine.CloneVM_Task*
    ///   
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### key
    /// The key fields of the Recommendations that are applied.
    ///
    /// ## Returns:
    ///
    /// Refers instance of *Task*.
    pub async fn apply_storage_drs_recommendation_task(&self, key: &[String]) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ApplyStorageDrsRecommendationRequestType {key, };
        let bytes = self.client.invoke("", "StorageResourceManager", &self.mo_id, "ApplyStorageDrsRecommendation_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Applies a recommendation from the recommendation list that is generated
    /// by SDRS load balancing activity.
    /// 
    /// Each recommendation can be applied
    /// only once.
    /// 
    /// Requires Resource.ApplyRecommendation privilege on the storage pod. And
    /// requires Resource.ColdMigrate privilege on the virtual machine(s) that
    /// are relocated. Additionally requires Resource.HotMigrate privilege if
    /// the virtual machine is powered on (for Storage VMotion). Also requires
    /// Datastore.AllocateSpace on any datastore the virtual machine or its disks
    /// are relocated to.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### pod
    /// The storage pod.
    /// 
    /// Refers instance of *StoragePod*.
    ///
    /// ### key
    /// The key field of the Recommendation.
    ///
    /// ## Returns:
    ///
    /// Refers instance of *Task*.
    pub async fn apply_storage_drs_recommendation_to_pod_task(&self, pod: &crate::types::structs::ManagedObjectReference, key: &str) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ApplyStorageDrsRecommendationToPodRequestType {pod, key, };
        let bytes = self.client.invoke("", "StorageResourceManager", &self.mo_id, "ApplyStorageDrsRecommendationToPod_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Cancels a recommendation.
    /// 
    /// Currently only initial placement
    /// recommendations can be cancelled. Migration recommendations cannot.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### key
    /// The key field of the Recommendation.
    pub async fn cancel_storage_drs_recommendation(&self, key: &[String]) -> Result<()> {
        let input = CancelStorageDrsRecommendationRequestType {key, };
        self.client.invoke_void("", "StorageResourceManager", &self.mo_id, "CancelStorageDrsRecommendation", Some(&input)).await
    }
    /// Change the storage DRS configuration for a pod *StoragePod*.
    ///
    /// ## Parameters:
    ///
    /// ### pod
    /// The storage pod.
    /// 
    /// ***Required privileges:*** StoragePod.Config
    /// 
    /// Refers instance of *StoragePod*.
    ///
    /// ### spec
    /// A set of storage Drs configuration changes to apply to the storage pod.
    /// The specification can be a complete set of changes or a partial
    /// set of changes, applied incrementally.
    ///
    /// ### modify
    /// Flag to specify whether the specification ("spec") should
    /// be applied incrementally. If "modify" is false and the
    /// operation succeeds, then the configuration of the storage pod
    /// matches the specification exactly; in this case any unset
    /// portions of the specification will result in unset or
    /// default portions of the configuration.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation.
    /// 
    /// Refers instance of *Task*.
    pub async fn configure_storage_drs_for_pod_task(&self, pod: &crate::types::structs::ManagedObjectReference, spec: &crate::types::structs::StorageDrsConfigSpec, modify: bool) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ConfigureStorageDrsForPodRequestType {pod, spec, modify, };
        let bytes = self.client.invoke("", "StorageResourceManager", &self.mo_id, "ConfigureStorageDrsForPod_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of vSphere8.0 U3, and there is no replacement for it.
    /// 
    /// Returns datastore summary performance statistics.
    /// 
    /// This is an experimental interface that is not intended for
    /// use in production code.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### datastore
    /// Datastore for which summary statistics is requested.
    /// 
    /// Refers instance of *Datastore*.
    ///
    /// ## Returns:
    ///
    /// Summary performance statistics for the datastore. The summary
    /// contains latency, throughput, and SIOC activity.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if input datastore cannot be found
    pub async fn query_datastore_performance_summary(&self, datastore: &crate::types::structs::ManagedObjectReference) -> Result<Option<Vec<crate::types::structs::StoragePerformanceSummary>>> {
        let input = QueryDatastorePerformanceSummaryRequestType {datastore, };
        let bytes_opt = self.client.invoke_optional("", "StorageResourceManager", &self.mo_id, "QueryDatastorePerformanceSummary", 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 returns a *StoragePlacementResult* object.
    /// 
    /// This API is intended to replace the following existing APIs for
    /// SDRS-enabled pods:
    /// CreateVm: StoragePlacementSpec::type == create =
    /// *Folder.CreateVM_Task*
    /// AddDisk: StoragePlacementSpec::type == reconfigure =
    /// *VirtualMachine.ReconfigVM_Task*
    /// RelocateVm: StoragePlacementSpec::type == relocate =
    /// *VirtualMachine.RelocateVM_Task*
    /// CloneVm: StoragePlacementSpec::type == clone =
    /// *VirtualMachine.CloneVM_Task*
    /// The PodSelectionSpec parameter in StoragePlacementSpec is required
    /// for all workflows. It specifies which SDRS-enabled pod the user
    /// has selected for the VM and/or for each disk.
    /// For CreateVm, RelocateVm and CloneVm, PodSelectionSpec.storagePod is
    /// the user selected SDRS pod for the VM, i.e., its system files.
    /// For all workflows, PodSelectionSpec.disk.storagePod is the
    /// user selected SDRS pod for the given disk. Note that a
    /// DiskLocator must be specified for each disk that the user
    /// requests to create, migrate or clone into an SDRS pod, even if it's
    /// the same pod as the VM or the user has manually selected a datastore
    /// within the pod. If the user has manually selected a datastore, the
    /// datastore must be specified in the workflow specific fields as
    /// described below.
    /// For CreateVm, AddDisk, the manually selected datastore
    /// must be specified in ConfigSpec.files or
    /// ConfigSpec.deviceChange.device.backing.datastore, the fields
    /// should will be unset if the user wants SDRS to recommend the datastore.
    /// For RelocateVm, the manually selected datastore must be specified in
    /// RelocateSpec.datastore or RelocateSpec.disk.datastore; the fields should
    /// be unset iff the user wants SDRS recommendations. For CloneVm, the
    /// manually selected datastore must be specified in
    /// CloneSpec.location.datastore or CloneSpec.location.disk\[\].datastore;
    /// the fields should be unset iff the user wants SDRS recommendations.
    /// The remaining expected input parameters in StoragePlacementSpec
    /// will be the same as those for the existing API as determined by
    /// StoragePlacementSpec::type. If a parameter is optional in the
    /// existing API, it will also be optional in the new API.
    /// - For CreateVm, the Folder, ConfigSpec, ResourcePool and HostSystem
    ///   parameters will be expected in StoragePlacementSpec. The disks
    ///   to be created can be determined by ConfigSpec -&gt;
    ///   VirtualDeviceSpec\[\] (deviceChange) -&gt; VirtualDevice (device) -&gt;
    ///   VirtualDisk (subclass).
    /// - For AddDisk, the VirtualMachine and ConfigSpec parameters will
    ///   be expected. The use of the ConfigSpec for determining the disks
    ///   to add will be the same as that in CreateVm.
    /// - For ExpandDisk, the VirtualMachine and ConfigSpec parameters will
    ///   be expected. The use of the ConfigSpec for determining the disks
    ///   to be expanded will be the same as the disks IDs of existing VM disks.
    /// - For RelocateVm, the VirtualMachine, RelocateSpec and
    ///   MovePriority parameters will be expected.
    /// - For CloneVm, the VirtualMachine, CloneSpec, Folder and cloneName
    ///   parameters will be expected.
    ///   
    /// SDRS takes into account constraints such as space usages,
    /// (anti-) affinity rules, datastore maintenance mode, etc. when
    /// making placement recommendations. Given that the constraints are
    /// satisfied, SDRS tries to balance space usages and I/O loads in
    /// the placement.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### storage_spec
    /// -
    pub async fn recommend_datastores(&self, storage_spec: &crate::types::structs::StoragePlacementSpec) -> Result<crate::types::structs::StoragePlacementResult> {
        let input = RecommendDatastoresRequestType {storage_spec, };
        let bytes = self.client.invoke("", "StorageResourceManager", &self.mo_id, "RecommendDatastores", Some(&input)).await?;
        let result: crate::types::structs::StoragePlacementResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Make Storage DRS invoke again on the specified pod *StoragePod*
    /// and return a new list of recommendations.
    /// 
    /// Concurrent "refresh" requests
    /// may be combined together and trigger only one Storage DRS invocation.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### pod
    /// The storage pod.
    /// The recommendations generated is stored at
    /// *PodStorageDrsEntry.recommendation*.
    /// 
    /// Refers instance of *StoragePod*.
    pub async fn refresh_storage_drs_recommendation(&self, pod: &crate::types::structs::ManagedObjectReference) -> Result<()> {
        let input = RefreshStorageDrsRecommendationRequestType {pod, };
        self.client.invoke_void("", "StorageResourceManager", &self.mo_id, "RefreshStorageDrsRecommendation", Some(&input)).await
    }
    /// Invoke Storage DRS on a specific pod *StoragePod*
    /// and return a new list of recommendations.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### pod
    /// The storage pod.
    /// The recommendations generated is stored at
    /// *PodStorageDrsEntry.recommendation*.
    /// 
    /// Refers instance of *StoragePod*.
    ///
    /// ## Returns:
    ///
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// Failure
    pub async fn refresh_storage_drs_recommendations_for_pod_task(&self, pod: &crate::types::structs::ManagedObjectReference) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = RefreshStorageDrsRecommendationsForPodRequestType {pod, };
        let bytes = self.client.invoke("", "StorageResourceManager", &self.mo_id, "RefreshStorageDrsRecommendationsForPod_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Validate the new storage DRS configuration for a pod
    /// *StoragePod*.
    /// 
    /// If validation fails, it will return with InvalidArgument fault.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### pod
    /// The storage pod.
    /// 
    /// Refers instance of *StoragePod*.
    ///
    /// ### spec
    /// A set of storage Drs configuration changes to apply to
    /// the storage pod.
    pub async fn validate_storage_pod_config(&self, pod: &crate::types::structs::ManagedObjectReference, spec: &crate::types::structs::StorageDrsConfigSpec) -> Result<Option<crate::types::structs::MethodFault>> {
        let input = ValidateStoragePodConfigRequestType {pod, spec, };
        let bytes_opt = self.client.invoke_optional("", "StorageResourceManager", &self.mo_id, "ValidateStoragePodConfig", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
}
struct ConfigureDatastoreIormRequestType<'a> {
    datastore: &'a crate::types::structs::ManagedObjectReference,
    spec: &'a crate::types::structs::StorageIormConfigSpec,
}

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

struct ConfigureDatastoreIormRequestTypeSer<'b, 'a> {
    data: &'b ConfigureDatastoreIormRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ConfigureDatastoreIormRequestTypeSer<'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"), &"ConfigureDatastoreIORMRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("datastore"), &self.data.datastore as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("spec"), &self.data.spec as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryIormConfigOptionRequestType<'a> {
    host: &'a crate::types::structs::ManagedObjectReference,
}

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

struct QueryIormConfigOptionRequestTypeSer<'b, 'a> {
    data: &'b QueryIormConfigOptionRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryIormConfigOptionRequestTypeSer<'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"), &"QueryIORMConfigOptionRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("host"), &self.data.host as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct ApplyStorageDrsRecommendationRequestType<'a> {
    key: &'a [String],
}

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

struct ApplyStorageDrsRecommendationRequestTypeSer<'b, 'a> {
    data: &'b ApplyStorageDrsRecommendationRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ApplyStorageDrsRecommendationRequestTypeSer<'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"), &"ApplyStorageDrsRecommendationRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("key"), &self.data.key as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct ApplyStorageDrsRecommendationToPodRequestType<'a> {
    pod: &'a crate::types::structs::ManagedObjectReference,
    key: &'a str,
}

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

struct ApplyStorageDrsRecommendationToPodRequestTypeSer<'b, 'a> {
    data: &'b ApplyStorageDrsRecommendationToPodRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ApplyStorageDrsRecommendationToPodRequestTypeSer<'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"), &"ApplyStorageDrsRecommendationToPodRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("pod"), &self.data.pod as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("key"), &self.data.key as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct CancelStorageDrsRecommendationRequestType<'a> {
    key: &'a [String],
}

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

struct CancelStorageDrsRecommendationRequestTypeSer<'b, 'a> {
    data: &'b CancelStorageDrsRecommendationRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for CancelStorageDrsRecommendationRequestTypeSer<'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"), &"CancelStorageDrsRecommendationRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("key"), &self.data.key as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct ConfigureStorageDrsForPodRequestType<'a> {
    pod: &'a crate::types::structs::ManagedObjectReference,
    spec: &'a crate::types::structs::StorageDrsConfigSpec,
    modify: bool,
}

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

struct ConfigureStorageDrsForPodRequestTypeSer<'b, 'a> {
    data: &'b ConfigureStorageDrsForPodRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ConfigureStorageDrsForPodRequestTypeSer<'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"), &"ConfigureStorageDrsForPodRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("pod"), &self.data.pod as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("spec"), &self.data.spec as &dyn miniserde::Serialize)),
            3 => return Some((std::borrow::Cow::Borrowed("modify"), &self.data.modify as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryDatastorePerformanceSummaryRequestType<'a> {
    datastore: &'a crate::types::structs::ManagedObjectReference,
}

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

struct QueryDatastorePerformanceSummaryRequestTypeSer<'b, 'a> {
    data: &'b QueryDatastorePerformanceSummaryRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryDatastorePerformanceSummaryRequestTypeSer<'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"), &"QueryDatastorePerformanceSummaryRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("datastore"), &self.data.datastore as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct RecommendDatastoresRequestType<'a> {
    storage_spec: &'a crate::types::structs::StoragePlacementSpec,
}

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

struct RecommendDatastoresRequestTypeSer<'b, 'a> {
    data: &'b RecommendDatastoresRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RecommendDatastoresRequestTypeSer<'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"), &"RecommendDatastoresRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("storageSpec"), &self.data.storage_spec as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct RefreshStorageDrsRecommendationRequestType<'a> {
    pod: &'a crate::types::structs::ManagedObjectReference,
}

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

struct RefreshStorageDrsRecommendationRequestTypeSer<'b, 'a> {
    data: &'b RefreshStorageDrsRecommendationRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RefreshStorageDrsRecommendationRequestTypeSer<'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"), &"RefreshStorageDrsRecommendationRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("pod"), &self.data.pod as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct RefreshStorageDrsRecommendationsForPodRequestType<'a> {
    pod: &'a crate::types::structs::ManagedObjectReference,
}

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

struct RefreshStorageDrsRecommendationsForPodRequestTypeSer<'b, 'a> {
    data: &'b RefreshStorageDrsRecommendationsForPodRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RefreshStorageDrsRecommendationsForPodRequestTypeSer<'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"), &"RefreshStorageDrsRecommendationsForPodRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("pod"), &self.data.pod as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct ValidateStoragePodConfigRequestType<'a> {
    pod: &'a crate::types::structs::ManagedObjectReference,
    spec: &'a crate::types::structs::StorageDrsConfigSpec,
}

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

struct ValidateStoragePodConfigRequestTypeSer<'b, 'a> {
    data: &'b ValidateStoragePodConfigRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ValidateStoragePodConfigRequestTypeSer<'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"), &"ValidateStoragePodConfigRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("pod"), &self.data.pod as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("spec"), &self.data.spec as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}