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
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// This managed object is the interface for scanning and patching an ESX
/// server.
/// 
/// VMware publishes updates through its external website. A patch update is
/// synonymous with a bulletin. An update may contain many individual patch
/// binaries, but its installation and uninstallation are atomic.
#[derive(Clone)]
pub struct HostPatchManager {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl HostPatchManager {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// Deprecated as of vSphere 8.0u3, and there is no replacement available.
    /// 
    /// Check the list of metadata and returns the dependency, obsolete and conflict information
    /// The operation is cancelable through the returned *Task* object.
    /// 
    /// No integrity checks
    /// are performed on the metadata.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Parameters:
    ///
    /// ### meta_urls
    /// a list of urls pointing to metadata.zip.
    ///
    /// ### bundle_urls
    /// a list of urls pointing to an "offline" bundle. It is not supported in 5.0 or later.
    ///
    /// ### spec
    /// -
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation. The *info.result* property in the
    /// *Task* contains the
    /// *HostPatchManagerStatus*
    /// upon success.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***RequestCanceled***: if the operation is canceled.
    /// 
    /// ***InvalidState***: if the feature cannot be supported on the platform,
    /// potentially because the hardware configuration does not support it.
    /// 
    /// ***TaskInProgress***: if there is already a patch installation in progress.
    /// 
    /// ***PlatformConfigFault***: if any error occurs during the operation.
    /// More detailed information will be returned within the payload of the
    /// exception as xml string.
    pub async fn check_host_patch_task(&self, meta_urls: Option<&[String]>, bundle_urls: Option<&[String]>, spec: Option<&crate::types::structs::HostPatchManagerPatchManagerOperationSpec>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = CheckHostPatchRequestType {meta_urls, bundle_urls, spec, };
        let bytes = self.client.invoke("", "HostPatchManager", &self.mo_id, "CheckHostPatch_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated method is deprecated, use *HostPatchManager.InstallHostPatchV2_Task* instead.
    /// 
    /// Patch the host.
    /// 
    /// The operation is not cancelable. If the
    /// patch installation failed, an atomic rollback of the installation will
    /// be attempted. Manual rollback is required if the atomic rollback
    /// failed, see *PatchInstallFailed* for details.
    /// 
    /// ***Required privileges:*** Host.Config.Patch
    ///
    /// ## Parameters:
    ///
    /// ### repository
    /// Location of the repository that contains the
    /// bulletin depot. The depot must be organized as a flat
    /// collection of bulletins with each one being a folder named
    /// after the bulletin ID. Each folder must contain both
    /// update metadata and required binaries.
    ///
    /// ### update_id
    /// The update to be installed on the host.
    ///
    /// ### force
    /// Specify whether to force reinstall an update.
    /// By default, installing an already-installed update would fail
    /// with the *PatchAlreadyInstalled* fault. If
    /// force is set to true, the update will be forcefully reinstalled,
    /// thus overwriting the already installed update.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***PatchMetadataInvalid***: if the required metadata is invalid - for
    /// example, it is not found in the repository, is corrupted and so
    /// on. Typically a more specific subclass of PatchMetadataInvalid is
    /// thrown.
    /// 
    /// ***PatchBinariesNotFound***: if required update related binaries were not
    /// available.
    /// 
    /// ***PatchNotApplicable***: if the patch is not applicable. Typically a
    /// more specific subclass of PatchNotApplicable is thrown to indicate
    /// a specific problem - for example, PatchSuperseded if the patch is
    /// superseded, MissingDependency if required patch or libraries are not
    /// installed, AlreadyInstalled if the patch is already installed.
    /// 
    /// ***NoDiskSpace***: if the update can not be installed because there is
    /// insufficient disk space for the installation, including temporary
    /// space used for rollback.
    /// 
    /// ***PatchInstallFailed***: if the installation failed,
    /// *PlatformConfigFault.text* has details of the
    /// failure. Automatic rollback might have succeeded or failed.
    /// 
    /// ***RebootRequired***: if the update cannot be installed without
    /// restarting the host. This might occur on account of a prior
    /// update installation which needed to be installed separately
    /// from other updates.
    /// 
    /// ***InvalidState***: if the host is not in maintenance mode but the
    /// patch install requires all virtual machines to be powered off.
    /// 
    /// ***TaskInProgress***: if there is already a patch installation in progress.
    pub async fn install_host_patch_task(&self, repository: &crate::types::structs::HostPatchManagerLocator, update_id: &str, force: Option<bool>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = InstallHostPatchRequestType {repository, update_id, force, };
        let bytes = self.client.invoke("", "HostPatchManager", &self.mo_id, "InstallHostPatch_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of vSphere 8.0u3, and there is no replacement available.
    /// 
    /// Patch the host.
    /// 
    /// The operation is not cancelable. If the
    /// patch installation failed, an atomic rollback of the installation will
    /// be attempted. Manual rollback is required if the atomic rollback
    /// failed, see *PatchInstallFailed* for details.
    /// 
    /// ***Required privileges:*** Host.Config.Patch
    ///
    /// ## Parameters:
    ///
    /// ### meta_urls
    /// A list of urls pointing to metadata.zip.
    ///
    /// ### bundle_urls
    /// a list of urls pointing to an "offline" bundle. It is not supported in 5.0 or later.
    ///
    /// ### vib_urls
    /// The urls of update binary files to be installed.
    ///
    /// ### spec
    /// -
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***RequestCanceled***: if the operation is canceled.
    /// 
    /// ***InvalidState***: if the feature cannot be supported on the platform,
    /// potentially because the hardware configuration does not support it.
    /// 
    /// ***TaskInProgress***: if there is already a patch installation in progress.
    /// 
    /// ***PlatformConfigFault***: if any error occurs during the operation.
    /// More detailed information will be returned within the payload of the
    /// exception as xml string.
    pub async fn install_host_patch_v_2_task(&self, meta_urls: Option<&[String]>, bundle_urls: Option<&[String]>, vib_urls: Option<&[String]>, spec: Option<&crate::types::structs::HostPatchManagerPatchManagerOperationSpec>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = InstallHostPatchV2RequestType {meta_urls, bundle_urls, vib_urls, spec, };
        let bytes = self.client.invoke("", "HostPatchManager", &self.mo_id, "InstallHostPatchV2_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of vSphere 8.0u3, and there is no replacement available.
    /// 
    /// Query the host for installed bulletins.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Parameters:
    ///
    /// ### spec
    /// -
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***RequestCanceled***: if the operation is canceled.
    /// 
    /// ***InvalidState***: if the bulletin ID did not exist.
    /// 
    /// ***TaskInProgress***: if there is already a patch installation in progress.
    /// 
    /// ***PlatformConfigFault***: if any error occurs during the operation.
    /// More detailed information will be returned within the payload of the
    /// exception as xml string.
    pub async fn query_host_patch_task(&self, spec: Option<&crate::types::structs::HostPatchManagerPatchManagerOperationSpec>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = QueryHostPatchRequestType {spec, };
        let bytes = self.client.invoke("", "HostPatchManager", &self.mo_id, "QueryHostPatch_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of VI API 4.0, use *HostPatchManager.ScanHostPatchV2_Task*.
    /// 
    /// Scan the host for the patch status.
    /// 
    /// The operation is cancelable
    /// through the returned *Task* object. Integrity checks are
    /// performed on the metadata only during the scan operation.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Parameters:
    ///
    /// ### repository
    /// Location of the repository that contains the
    /// bulletin depot. The depot must be organized as a flat
    /// collection of bulletins with each one being a folder named
    /// after the bulletin ID. Each folder must contain the full
    /// update metadata.
    ///
    /// ### update_id
    /// The updates to scan. Wildcards can be used to specify
    /// the update IDs. The wildcards will be expanded to include all
    /// updates whose IDs match the specified wildcard and whose metadata
    /// is available in the repository. Specifying no update is
    /// equivalent to a wildcard "\*". In this case all updates available
    /// in the repository will be scanned.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation. The *info.result* property in the
    /// *Task* contains the
    /// *HostPatchManagerStatus*
    /// upon success.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***RequestCanceled***: if the operation is canceled.
    /// 
    /// ***PatchMetadataInvalid***: if query required metadata is invalid - for
    /// example, it is not found in the repository, is corrupted and
    /// so on. Typically a more specific subclass of PatchMetadataInvalid
    /// is thrown.
    /// 
    /// ***PlatformConfigFault***: if there is any error in the repository access,
    /// metadata download, repository level integrity check, or reading the
    /// metadata. See *PlatformConfigFault.text* for
    /// specific details.
    pub async fn scan_host_patch_task(&self, repository: &crate::types::structs::HostPatchManagerLocator, update_id: Option<&[String]>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ScanHostPatchRequestType {repository, update_id, };
        let bytes = self.client.invoke("", "HostPatchManager", &self.mo_id, "ScanHostPatch_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of vSphere 8.0u3, and there is no replacement available.
    /// 
    /// Scan the host for the patch status.
    /// 
    /// The operation is cancelable
    /// through the returned *Task* object. Integrity checks are
    /// performed on the metadata only during the scan operation.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Parameters:
    ///
    /// ### meta_urls
    /// a list of urls pointing to metadata.zip.
    ///
    /// ### bundle_urls
    /// a list of urls pointing to an "offline" bundle. It is not supported in 5.0 or later.
    ///
    /// ### spec
    /// -
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation. The *info.result* property in the
    /// *Task* contains the
    /// *HostPatchManagerStatus*
    /// upon success.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***RequestCanceled***: if the operation is canceled.
    /// 
    /// ***InvalidState***: if the feature cannot be supported on the platform,
    /// potentially because the hardware configuration does not support it.
    /// 
    /// ***TaskInProgress***: if there is already a patch installation in progress.
    /// 
    /// ***PlatformConfigFault***: if there is any error in the repository access,
    /// metadata download, repository level integrity check, or reading the
    /// metadata. See *PlatformConfigFault.text* for
    /// specific details.
    pub async fn scan_host_patch_v_2_task(&self, meta_urls: Option<&[String]>, bundle_urls: Option<&[String]>, spec: Option<&crate::types::structs::HostPatchManagerPatchManagerOperationSpec>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ScanHostPatchV2RequestType {meta_urls, bundle_urls, spec, };
        let bytes = self.client.invoke("", "HostPatchManager", &self.mo_id, "ScanHostPatchV2_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of vSphere 8.0u3, and there is no replacement available.
    /// 
    /// Stage the vib files to esx local location and possibly do some run time check.
    /// 
    /// ***Required privileges:*** Host.Config.Patch
    ///
    /// ## Parameters:
    ///
    /// ### meta_urls
    /// A list of urls pointing to metadata.zip.
    ///
    /// ### bundle_urls
    /// a list of urls pointing to an "offline" bundle. It is not supported in 5.0 or later.
    ///
    /// ### vib_urls
    /// The urls of update binary files to be staged.
    ///
    /// ### spec
    /// -
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation. The *info.result* property in the
    /// *Task* contains the
    /// *HostPatchManagerStatus*
    /// upon success.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***RequestCanceled***: if the operation is canceled.
    /// 
    /// ***InvalidState***: if the feature cannot be supported on the platform,
    /// potentially because the hardware configuration does not support it.
    /// 
    /// ***TaskInProgress***: if there is already a patch installation in progress.
    /// 
    /// ***PlatformConfigFault***: if any error occurs during the operation.
    /// More detailed information will be returned within the payload of the
    /// exception as xml string.
    pub async fn stage_host_patch_task(&self, meta_urls: Option<&[String]>, bundle_urls: Option<&[String]>, vib_urls: Option<&[String]>, spec: Option<&crate::types::structs::HostPatchManagerPatchManagerOperationSpec>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = StageHostPatchRequestType {meta_urls, bundle_urls, vib_urls, spec, };
        let bytes = self.client.invoke("", "HostPatchManager", &self.mo_id, "StageHostPatch_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of vSphere 8.0u3, and there is no replacement available.
    /// 
    /// Uninstall patch from the host.
    /// 
    /// The operation is not cancelable.
    /// 
    /// ***Required privileges:*** Host.Config.Patch
    ///
    /// ## Parameters:
    ///
    /// ### bulletin_ids
    /// A list of bulletin IDs to be removed.
    ///
    /// ### spec
    /// -
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: if the feature cannot be supported on the platform,
    /// potentially because the hardware configuration does not support it.
    /// 
    /// ***TaskInProgress***: if there is already a patch installation in progress.
    /// 
    /// ***PlatformConfigFault***: if any error occurs during the operation.
    /// More detailed information will be returned within the payload of the
    /// exception as xml string.
    pub async fn uninstall_host_patch_task(&self, bulletin_ids: Option<&[String]>, spec: Option<&crate::types::structs::HostPatchManagerPatchManagerOperationSpec>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = UninstallHostPatchRequestType {bulletin_ids, spec, };
        let bytes = self.client.invoke("", "HostPatchManager", &self.mo_id, "UninstallHostPatch_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
}
struct CheckHostPatchRequestType<'a> {
    meta_urls: Option<&'a [String]>,
    bundle_urls: Option<&'a [String]>,
    spec: Option<&'a crate::types::structs::HostPatchManagerPatchManagerOperationSpec>,
}

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

struct CheckHostPatchRequestTypeSer<'b, 'a> {
    data: &'b CheckHostPatchRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for CheckHostPatchRequestTypeSer<'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"), &"CheckHostPatchRequestType")),
                1 => {
                    let Some(ref val) = self.data.meta_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("metaUrls"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.bundle_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("bundleUrls"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct InstallHostPatchRequestType<'a> {
    repository: &'a crate::types::structs::HostPatchManagerLocator,
    update_id: &'a str,
    force: Option<bool>,
}

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

struct InstallHostPatchRequestTypeSer<'b, 'a> {
    data: &'b InstallHostPatchRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for InstallHostPatchRequestTypeSer<'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"), &"InstallHostPatchRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("repository"), &self.data.repository as &dyn miniserde::Serialize)),
                2 => return Some((std::borrow::Cow::Borrowed("updateID"), &self.data.update_id as &dyn miniserde::Serialize)),
                3 => {
                    let Some(ref val) = self.data.force else { continue; };
                    return Some((std::borrow::Cow::Borrowed("force"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct InstallHostPatchV2RequestType<'a> {
    meta_urls: Option<&'a [String]>,
    bundle_urls: Option<&'a [String]>,
    vib_urls: Option<&'a [String]>,
    spec: Option<&'a crate::types::structs::HostPatchManagerPatchManagerOperationSpec>,
}

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

struct InstallHostPatchV2RequestTypeSer<'b, 'a> {
    data: &'b InstallHostPatchV2RequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for InstallHostPatchV2RequestTypeSer<'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"), &"InstallHostPatchV2RequestType")),
                1 => {
                    let Some(ref val) = self.data.meta_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("metaUrls"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.bundle_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("bundleUrls"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.vib_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("vibUrls"), val as &dyn miniserde::Serialize));
                }
                4 => {
                    let Some(ref val) = self.data.spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct QueryHostPatchRequestType<'a> {
    spec: Option<&'a crate::types::structs::HostPatchManagerPatchManagerOperationSpec>,
}

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

struct QueryHostPatchRequestTypeSer<'b, 'a> {
    data: &'b QueryHostPatchRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryHostPatchRequestTypeSer<'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"), &"QueryHostPatchRequestType")),
                1 => {
                    let Some(ref val) = self.data.spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct ScanHostPatchRequestType<'a> {
    repository: &'a crate::types::structs::HostPatchManagerLocator,
    update_id: Option<&'a [String]>,
}

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

struct ScanHostPatchRequestTypeSer<'b, 'a> {
    data: &'b ScanHostPatchRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ScanHostPatchRequestTypeSer<'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"), &"ScanHostPatchRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("repository"), &self.data.repository as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.update_id else { continue; };
                    return Some((std::borrow::Cow::Borrowed("updateID"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct ScanHostPatchV2RequestType<'a> {
    meta_urls: Option<&'a [String]>,
    bundle_urls: Option<&'a [String]>,
    spec: Option<&'a crate::types::structs::HostPatchManagerPatchManagerOperationSpec>,
}

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

struct ScanHostPatchV2RequestTypeSer<'b, 'a> {
    data: &'b ScanHostPatchV2RequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ScanHostPatchV2RequestTypeSer<'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"), &"ScanHostPatchV2RequestType")),
                1 => {
                    let Some(ref val) = self.data.meta_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("metaUrls"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.bundle_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("bundleUrls"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct StageHostPatchRequestType<'a> {
    meta_urls: Option<&'a [String]>,
    bundle_urls: Option<&'a [String]>,
    vib_urls: Option<&'a [String]>,
    spec: Option<&'a crate::types::structs::HostPatchManagerPatchManagerOperationSpec>,
}

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

struct StageHostPatchRequestTypeSer<'b, 'a> {
    data: &'b StageHostPatchRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for StageHostPatchRequestTypeSer<'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"), &"StageHostPatchRequestType")),
                1 => {
                    let Some(ref val) = self.data.meta_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("metaUrls"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.bundle_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("bundleUrls"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.vib_urls else { continue; };
                    return Some((std::borrow::Cow::Borrowed("vibUrls"), val as &dyn miniserde::Serialize));
                }
                4 => {
                    let Some(ref val) = self.data.spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct UninstallHostPatchRequestType<'a> {
    bulletin_ids: Option<&'a [String]>,
    spec: Option<&'a crate::types::structs::HostPatchManagerPatchManagerOperationSpec>,
}

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

struct UninstallHostPatchRequestTypeSer<'b, 'a> {
    data: &'b UninstallHostPatchRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for UninstallHostPatchRequestTypeSer<'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"), &"UninstallHostPatchRequestType")),
                1 => {
                    let Some(ref val) = self.data.bulletin_ids else { continue; };
                    return Some((std::borrow::Cow::Borrowed("bulletinIds"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("spec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}