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
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// This managed object type provides the file service related configuration
/// and query APIs.
/// 
/// It can be accessed through MOID of 'vsan-cluster-file-service-system',
/// through vSAN service on vCenter at cluster level, or accessed through MOID
/// of 'vsan-file-service-system' on ESXi host for the detailed operation.
#[derive(Clone)]
pub struct VsanFileServiceSystem {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl VsanFileServiceSystem {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// Creates a file service domain in the vSAN cluster.
    /// 
    /// A vSAN file service domain is designed with the following properties:
    /// - A file service domain has a FQDN domain name (e.g., fs.mycompany.com)
    ///   that client can mount.
    /// - It can join an Active Directory domain and use Kerberos for
    ///   authentication and user ID mapping, or use AUTH\_SYS to trust user ID
    ///   sent from clients.
    /// - One more more file shares can be created in a file service domain
    ///   and all these file shares have the same security/network properties
    ///   of this file service domain. These file shares can be accessed from a
    ///   certain network (e.g., VM Network).
    ///   
    /// In current version, only one file service domain can be created per cluster,
    /// which can be initiated when the file service is enabled.
    ///
    /// ## Parameters:
    ///
    /// ### domain_config
    /// Domain configuration information.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// A task tracking the domain creation progress.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception when vSAN file service is not enabled in
    /// this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the domain name already configured in the cluster.
    pub async fn vsan_cluster_create_fs_domain(&self, domain_config: &crate::types::structs::VsanFileServiceDomainConfig, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanClusterCreateFsDomainRequestType {domain_config, cluster, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterCreateFsDomain", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Creates a file share in this vSAN cluster.
    ///
    /// ## Parameters:
    ///
    /// ### config
    /// The file share configuration, as specified in
    /// . Note that the backing vSAN object for the
    /// file share will be by default 1TB if the file share is thin
    /// provisioned. Otherwise the backing vSAN object is set to 255GB if
    /// quota is not set.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// A task tracking the share creation progress. The UUID of the file
    /// share will be set to the task result field if the task succeeds.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception when vSAN file service is not enabled in
    /// this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the domain for this new file share does not exist
    /// in this cluster.
    pub async fn vsan_create_file_share(&self, config: &crate::types::structs::VsanFileShareConfig, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanCreateFileShareRequestType {config, cluster, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanCreateFileShare", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Create a snapshot for a file share in this vSAN cluster.
    ///
    /// ## Parameters:
    ///
    /// ### config
    /// The snapshot configuration.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// A task tracking the snapshot creation progress.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception for invalid states, for example, if vSAN
    /// file service is not enabled in this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the file share to create a snapshot does not exist
    /// in this cluster.
    pub async fn vsan_cluster_create_share_snapshot(&self, config: &crate::types::structs::VsanFileShareSnapshotConfig, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanClusterCreateShareSnapshotRequestType {config, cluster, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterCreateShareSnapshot", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Downloads a file service OVF file of the specified version from VMware
    /// website and install it to the OVF repository in vCenter.
    /// 
    /// ***Required privileges:*** Global.VCServer
    ///
    /// ## Parameters:
    ///
    /// ### download_url
    /// URL to download the vSAN file service OVF, only HTTPS URL
    /// is supported.
    ///
    /// ## Returns:
    ///
    /// Task for tracking the OVF installation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: Exception if the OVF of the specified version does
    /// not exist as specified in the source URL.
    pub async fn vsan_download_file_service_ovf(&self, download_url: &str) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanDownloadFileServiceOvfRequestType {download_url, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanDownloadFileServiceOvf", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Find a compatible vSAN File Service OVF download URL for the target cluster.
    /// 
    /// This API needs internet access to fetch the latest OVF download URL for the
    /// specified cluster.
    ///
    /// ## Parameters:
    ///
    /// ### cluster
    /// The target cluster to download OVF files.
    /// 
    /// ***Required privileges:*** System.Read
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// The OVF download URL. Return an empty string if no proper OVF
    /// download URL could be found.
    pub async fn vsan_find_ovf_download_url(&self, cluster: &crate::types::structs::ManagedObjectReference) -> Result<String> {
        let input = VsanFindOvfDownloadUrlRequestType {cluster, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanFindOvfDownloadUrl", Some(&input)).await?;
        let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Perform a preflight check on a cluster for enabling vSAN file service
    /// and/or for the new file service domain configuration.
    /// 
    /// The preflight check items includes:
    /// - Basic check
    ///   - Network partition check
    ///   - vSAN datastore presence to each host
    ///   - The versions of the ESXi hosts match in this cluster
    ///   - NTP configuration check in ESXi hosts if vSAN file service
    ///     version is 8.0 or newer
    ///   - Domain configuration format check
    ///   - Running OVF information check
    ///   - If a DVS portgroup is passed as network,
    ///     it checks if DVS version is older than 6.6
    /// - Advanced check
    ///   - Checks covered in 'basic' scope
    ///   - File server domain configuration validation in live environment
    ///     when vSAN file service has been enabled
    ///
    /// ## Parameters:
    ///
    /// ### cluster
    /// The target cluster to perform preflight check.
    /// 
    /// ***Required privileges:*** System.Read
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ### domain_config
    /// The domain configuration to be validated.
    /// If not specified, the validation for the
    /// domain will be skipped.
    ///
    /// ### network
    /// The network which will be used for fs containers
    /// 
    /// Refers instance of *Network*.
    ///
    /// ### scope
    /// The scope that preflight check will cover. Valid inputs are
    /// listed in the *VsanFileServicePreflightCheckScope_enum*
    /// field. Defaults to "basic".
    ///
    /// ### domain_uuid
    /// The file service domain UUID. It is required when
    /// the advanced preflight check is performed on an
    /// existing domain. If a new file service domain is
    /// to be created, leave it empty.
    ///
    /// ## Returns:
    ///
    /// Preflight check result.
    pub async fn vsan_perform_file_service_enable_preflight_check(&self, cluster: &crate::types::structs::ManagedObjectReference, domain_config: Option<&crate::types::structs::VsanFileServiceDomainConfig>, network: Option<&crate::types::structs::ManagedObjectReference>, scope: Option<&str>, domain_uuid: Option<&str>) -> Result<crate::types::structs::VsanFileServicePreflightCheckResult> {
        let input = VsanPerformFileServiceEnablePreflightCheckRequestType {cluster, domain_config, network, scope, domain_uuid, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanPerformFileServiceEnablePreflightCheck", Some(&input)).await?;
        let result: crate::types::structs::VsanFileServicePreflightCheckResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Lists all file service domains in the vSAN cluster.
    /// 
    /// To list all the file service domains, leave both the uuids and names
    /// field empty. Otherwise the return result will be a set of file service
    /// domains matches the domain UUID or domain name provided in the parameters.
    /// If both fields are provided, only those file service domain with both
    /// domain name and domain UUID matched will be returned.
    ///
    /// ## Parameters:
    ///
    /// ### query_spec
    /// The specifications of the file service domains to be
    /// queried.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** System.Read
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// List of all the domain information on this host.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception when the file service is not enabled in this
    /// cluster.
    pub async fn vsan_cluster_query_fs_domains(&self, query_spec: Option<&crate::types::structs::VsanFileServiceDomainQuerySpec>, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<Option<Vec<crate::types::structs::VsanFileServiceDomain>>> {
        let input = VsanClusterQueryFsDomainsRequestType {query_spec, cluster, };
        let bytes_opt = self.client.invoke_optional("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterQueryFsDomains", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Lists all available vSAN File Service OVF in this vCenter.
    /// 
    /// ***Required privileges:*** Global.VCServer
    ///
    /// ## Returns:
    ///
    /// List of the file services OVFs available in this vCenter.
    pub async fn vsan_query_file_service_ovfs(&self) -> Result<Option<Vec<crate::types::structs::VsanFileServiceOvfSpec>>> {
        let bytes_opt = self.client.invoke_optional("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanQueryFileServiceOvfs", None).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// List all the snapshots that match the query spec.
    ///
    /// ## Parameters:
    ///
    /// ### query_spec
    /// The specification of the snapshots to be queried.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** System.Read
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// Result of the snapshot query.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception for invalid states, for example, if vSAN
    /// file service is not enabled in this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the share does not exist in this cluster.
    pub async fn vsan_cluster_query_share_snapshots(&self, query_spec: &crate::types::structs::VsanFileShareSnapshotQuerySpec, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<Option<crate::types::structs::VsanFileShareSnapshotQueryResult>> {
        let input = VsanClusterQueryShareSnapshotsRequestType {query_spec, cluster, };
        let bytes_opt = self.client.invoke_optional("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterQueryShareSnapshots", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Lists all file shares in the domain.
    /// 
    /// To list all the file shares in the domain, leave both the shareUuids and
    /// shareNames field empty. Otherwise the return result will be a set of file
    /// shares matches the share UUID or share name provided in the parameters. If
    /// both fields are provided, only those file shares with both share name and
    /// share UUID matched will be returned.
    /// Note that if none of file shares matches the querySpec, the return value is
    /// None.
    ///
    /// ## Parameters:
    ///
    /// ### query_spec
    /// The specifications of the file shares to be queried.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** System.Read
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// Result of the file share query.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception when vSAN file service is not enabled in
    /// this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the domain does not exist in this cluster.
    pub async fn vsan_cluster_query_file_shares(&self, query_spec: &crate::types::structs::VsanFileShareQuerySpec, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<Option<crate::types::structs::FileShareQueryResult>> {
        let input = VsanClusterQueryFileSharesRequestType {query_spec, cluster, };
        let bytes_opt = self.client.invoke_optional("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterQueryFileShares", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// This API is to rebalance file service in cluster.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    ///
    /// ## Parameters:
    ///
    /// ### cluster
    /// The target cluster to do rebalance.
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// the task tracking the rebalance progress.
    /// 
    /// Refers instance of *Task*.
    pub async fn vsan_rebalance_file_service(&self, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanRebalanceFileServiceRequestType {cluster, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanRebalanceFileService", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Updates a file service domain in the vSAN cluster.
    ///
    /// ## Parameters:
    ///
    /// ### domain_uuid
    /// The UUID of the domain to be reconfigured.
    ///
    /// ### domain_config
    /// New configuration of the domain. Only set the fields that
    /// require reconfiguration, and leave others unset.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ### delete_domain_config_fields
    /// The domain config fields to be deleted. For
    /// example to remove directoryServerConfig
    /// from the domainConfig provide
    /// \["directoryServerConfig"\] here and keep the
    /// same unset in provided domainConfig. Do note
    /// removing directoryServerConfig is only
    /// allowed when there are no active shares.
    /// Here is the list of currently supported field:
    /// - directoryServerConfig since 7.0U1
    /// - directoryServerConfig.preferredADServers
    ///   since 8.0U1 
    ///   
    /// Providing any other value here will cause
    /// InvalidArgumentError fault.
    ///
    /// ## Returns:
    ///
    /// A task tracking the domain reconfiguration progress.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception when vSAN file service is not enabled in
    /// this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the domain does not exist in this cluster.
    pub async fn vsan_cluster_reconfigure_fs_domain(&self, domain_uuid: &str, domain_config: &crate::types::structs::VsanFileServiceDomainConfig, cluster: Option<&crate::types::structs::ManagedObjectReference>, delete_domain_config_fields: Option<&[String]>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanClusterReconfigureFsDomainRequestType {domain_uuid, domain_config, cluster, delete_domain_config_fields, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterReconfigureFsDomain", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Reconfigures a file share in this vSAN cluster.
    /// 
    /// All the configurations of a vSAN file share can be reconfigured through this
    /// API, except the file service domain.
    ///
    /// ## Parameters:
    ///
    /// ### share_uuid
    /// The UUID of the file share to be reconfigured.
    ///
    /// ### config
    /// The file services configuration. Only set the fields that
    /// require reconfiguration, and leave the others unset.
    /// This API will update or create the labels specified in the
    /// config. Labels to be deleted should be specified in the
    /// 'deleteLabelKeys' parameter. Other labels will remain intact.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ### delete_label_keys
    /// The keys of share labels to be deleted. If a specified
    /// label key does not exist in the file share, the deletion of
    /// this label will be ignored.
    ///
    /// ### force
    /// The force flag is to force the reconfiguration of a vSphere
    /// managed file share, for example, the file share managed by Cloud
    /// Native Storage (CNS) service.
    ///
    /// ## Returns:
    ///
    /// A task tracking the share reconfiguring progress.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception when vSAN file service is not enabled in
    /// this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the file share does not exist in this cluster.
    pub async fn vsan_reconfigure_file_share(&self, share_uuid: &str, config: &crate::types::structs::VsanFileShareConfig, cluster: Option<&crate::types::structs::ManagedObjectReference>, delete_label_keys: Option<&[String]>, force: Option<bool>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanReconfigureFileShareRequestType {share_uuid, config, cluster, delete_label_keys, force, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanReconfigureFileShare", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Removes a file service domain in the vSAN cluster.
    /// 
    /// A file service domain is not allowed to be removed if it still has any
    /// file shares.
    ///
    /// ## Parameters:
    ///
    /// ### domain_uuid
    /// The unique domain uuid that is configured in the directory
    /// service, for example, Active Directory (AD) from Microsoft.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// A task tracking the domain remove progress.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception when vSAN file service is not enabled in
    /// this cluster, or it still has file shares.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the domain does not exist in this cluster.
    pub async fn vsan_cluster_remove_fs_domain(&self, domain_uuid: &str, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanClusterRemoveFsDomainRequestType {domain_uuid, cluster, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterRemoveFsDomain", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Removes a file share in the domain.
    ///
    /// ## Parameters:
    ///
    /// ### share_uuid
    /// The UUID of the file share to be removed.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ### force
    /// The force flag is to force the removal of a vSphere managed
    /// file share, for example, the file share managed by Cloud
    /// Native Storage (CNS) service.
    ///
    /// ## Returns:
    ///
    /// A task tracking the file share remove progress.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception when vSAN file service is not enabled in
    /// this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the file share does not exist in this cluster.
    pub async fn vsan_cluster_remove_share(&self, share_uuid: &str, cluster: Option<&crate::types::structs::ManagedObjectReference>, force: Option<bool>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanClusterRemoveShareRequestType {share_uuid, cluster, force, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterRemoveShare", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Remove a snapshot of a file share in this vSAN cluster.
    /// 
    /// Note: due to the limitation, it's not allowed to remove the latest snapshot
    /// for file service in 70U2 and an InvalidState exception will be thrown for
    /// this case.
    ///
    /// ## Parameters:
    ///
    /// ### share_uuid
    /// UUID of the file share to delete the snapshots.
    ///
    /// ### snapshot_name
    /// Name of the snapshot to be deleted.
    ///
    /// ### cluster
    /// The target cluster. Ignored when called on ESXi hosts.
    /// 
    /// ***Required privileges:*** Host.Config.Storage
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// A task tracking the snapshot remove progress.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception for invalid states, for example, if vSAN
    /// file service is not enabled in this cluster.
    /// 
    /// ***InvalidArgument***: Exception for invalid input arguments, for example,
    /// if the snapshot does not exist in this cluster.
    pub async fn vsan_cluster_remove_share_snapshot(&self, share_uuid: &str, snapshot_name: &str, cluster: Option<&crate::types::structs::ManagedObjectReference>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanClusterRemoveShareSnapshotRequestType {share_uuid, snapshot_name, cluster, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanClusterRemoveShareSnapshot", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Upgrade FSVM to latest ovf that is compatible with cluster's host version.
    /// 
    /// A compatible OVF is expected be uploaded before calling this API.
    /// A preflight check will be conducted before the upgrade on the following API.
    ///
    /// ## Parameters:
    ///
    /// ### cluster
    /// The target cluster in which FSVM deployed.
    /// 
    /// ***Required privileges:*** Host.Inventory.EditCluster
    /// 
    /// Refers instance of *ClusterComputeResource*.
    ///
    /// ## Returns:
    ///
    /// None
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: Exception if the OVF of the compatible version for the
    /// hosts cannot be found on the corresponding vCenter
    /// server, or file service is not running in a valid state.
    pub async fn vsan_upgrade_fsvm(&self, cluster: &crate::types::structs::ManagedObjectReference) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = VsanUpgradeFsvmRequestType {cluster, };
        let bytes = self.client.invoke("vsan", "VsanFileServiceSystem", &self.mo_id, "VsanUpgradeFsvm", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
}
struct VsanClusterCreateFsDomainRequestType<'a> {
    domain_config: &'a crate::types::structs::VsanFileServiceDomainConfig,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanClusterCreateFsDomainRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterCreateFsDomainRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterCreateFsDomainRequestTypeSer<'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"), &"VsanClusterCreateFsDomainRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("domainConfig"), &self.data.domain_config as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanCreateFileShareRequestType<'a> {
    config: &'a crate::types::structs::VsanFileShareConfig,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanCreateFileShareRequestTypeSer<'b, 'a> {
    data: &'b VsanCreateFileShareRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanCreateFileShareRequestTypeSer<'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"), &"VsanCreateFileShareRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("config"), &self.data.config as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanClusterCreateShareSnapshotRequestType<'a> {
    config: &'a crate::types::structs::VsanFileShareSnapshotConfig,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanClusterCreateShareSnapshotRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterCreateShareSnapshotRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterCreateShareSnapshotRequestTypeSer<'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"), &"VsanClusterCreateShareSnapshotRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("config"), &self.data.config as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanDownloadFileServiceOvfRequestType<'a> {
    download_url: &'a str,
}

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

struct VsanDownloadFileServiceOvfRequestTypeSer<'b, 'a> {
    data: &'b VsanDownloadFileServiceOvfRequestType<'a>,
    seq: usize,
}

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

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

struct VsanFindOvfDownloadUrlRequestTypeSer<'b, 'a> {
    data: &'b VsanFindOvfDownloadUrlRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanFindOvfDownloadUrlRequestTypeSer<'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"), &"VsanFindOvfDownloadUrlRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("cluster"), &self.data.cluster as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct VsanPerformFileServiceEnablePreflightCheckRequestType<'a> {
    cluster: &'a crate::types::structs::ManagedObjectReference,
    domain_config: Option<&'a crate::types::structs::VsanFileServiceDomainConfig>,
    network: Option<&'a crate::types::structs::ManagedObjectReference>,
    scope: Option<&'a str>,
    domain_uuid: Option<&'a str>,
}

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

struct VsanPerformFileServiceEnablePreflightCheckRequestTypeSer<'b, 'a> {
    data: &'b VsanPerformFileServiceEnablePreflightCheckRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanPerformFileServiceEnablePreflightCheckRequestTypeSer<'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"), &"VsanPerformFileServiceEnablePreflightCheckRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("cluster"), &self.data.cluster as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.domain_config else { continue; };
                    return Some((std::borrow::Cow::Borrowed("domainConfig"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.network else { continue; };
                    return Some((std::borrow::Cow::Borrowed("network"), val as &dyn miniserde::Serialize));
                }
                4 => {
                    let Some(ref val) = self.data.scope else { continue; };
                    return Some((std::borrow::Cow::Borrowed("scope"), val as &dyn miniserde::Serialize));
                }
                5 => {
                    let Some(ref val) = self.data.domain_uuid else { continue; };
                    return Some((std::borrow::Cow::Borrowed("domainUuid"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanClusterQueryFsDomainsRequestType<'a> {
    query_spec: Option<&'a crate::types::structs::VsanFileServiceDomainQuerySpec>,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanClusterQueryFsDomainsRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterQueryFsDomainsRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterQueryFsDomainsRequestTypeSer<'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"), &"VsanClusterQueryFsDomainsRequestType")),
                1 => {
                    let Some(ref val) = self.data.query_spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("querySpec"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanClusterQueryShareSnapshotsRequestType<'a> {
    query_spec: &'a crate::types::structs::VsanFileShareSnapshotQuerySpec,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanClusterQueryShareSnapshotsRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterQueryShareSnapshotsRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterQueryShareSnapshotsRequestTypeSer<'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"), &"VsanClusterQueryShareSnapshotsRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("querySpec"), &self.data.query_spec as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanClusterQueryFileSharesRequestType<'a> {
    query_spec: &'a crate::types::structs::VsanFileShareQuerySpec,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanClusterQueryFileSharesRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterQueryFileSharesRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterQueryFileSharesRequestTypeSer<'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"), &"VsanClusterQueryFileSharesRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("querySpec"), &self.data.query_spec as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanRebalanceFileServiceRequestType<'a> {
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanRebalanceFileServiceRequestTypeSer<'b, 'a> {
    data: &'b VsanRebalanceFileServiceRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanRebalanceFileServiceRequestTypeSer<'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"), &"VsanRebalanceFileServiceRequestType")),
                1 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanClusterReconfigureFsDomainRequestType<'a> {
    domain_uuid: &'a str,
    domain_config: &'a crate::types::structs::VsanFileServiceDomainConfig,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
    delete_domain_config_fields: Option<&'a [String]>,
}

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

struct VsanClusterReconfigureFsDomainRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterReconfigureFsDomainRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterReconfigureFsDomainRequestTypeSer<'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"), &"VsanClusterReconfigureFsDomainRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("domainUuid"), &self.data.domain_uuid as &dyn miniserde::Serialize)),
                2 => return Some((std::borrow::Cow::Borrowed("domainConfig"), &self.data.domain_config as &dyn miniserde::Serialize)),
                3 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                4 => {
                    let Some(ref val) = self.data.delete_domain_config_fields else { continue; };
                    return Some((std::borrow::Cow::Borrowed("deleteDomainConfigFields"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanReconfigureFileShareRequestType<'a> {
    share_uuid: &'a str,
    config: &'a crate::types::structs::VsanFileShareConfig,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
    delete_label_keys: Option<&'a [String]>,
    force: Option<bool>,
}

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

struct VsanReconfigureFileShareRequestTypeSer<'b, 'a> {
    data: &'b VsanReconfigureFileShareRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanReconfigureFileShareRequestTypeSer<'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"), &"VsanReconfigureFileShareRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("shareUuid"), &self.data.share_uuid as &dyn miniserde::Serialize)),
                2 => return Some((std::borrow::Cow::Borrowed("config"), &self.data.config as &dyn miniserde::Serialize)),
                3 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                4 => {
                    let Some(ref val) = self.data.delete_label_keys else { continue; };
                    return Some((std::borrow::Cow::Borrowed("deleteLabelKeys"), val as &dyn miniserde::Serialize));
                }
                5 => {
                    let Some(ref val) = self.data.force else { continue; };
                    return Some((std::borrow::Cow::Borrowed("force"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanClusterRemoveFsDomainRequestType<'a> {
    domain_uuid: &'a str,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanClusterRemoveFsDomainRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterRemoveFsDomainRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterRemoveFsDomainRequestTypeSer<'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"), &"VsanClusterRemoveFsDomainRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("domainUuid"), &self.data.domain_uuid as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanClusterRemoveShareRequestType<'a> {
    share_uuid: &'a str,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
    force: Option<bool>,
}

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

struct VsanClusterRemoveShareRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterRemoveShareRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterRemoveShareRequestTypeSer<'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"), &"VsanClusterRemoveShareRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("shareUuid"), &self.data.share_uuid as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val 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 VsanClusterRemoveShareSnapshotRequestType<'a> {
    share_uuid: &'a str,
    snapshot_name: &'a str,
    cluster: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct VsanClusterRemoveShareSnapshotRequestTypeSer<'b, 'a> {
    data: &'b VsanClusterRemoveShareSnapshotRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for VsanClusterRemoveShareSnapshotRequestTypeSer<'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"), &"VsanClusterRemoveShareSnapshotRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("shareUuid"), &self.data.share_uuid as &dyn miniserde::Serialize)),
                2 => return Some((std::borrow::Cow::Borrowed("snapshotName"), &self.data.snapshot_name as &dyn miniserde::Serialize)),
                3 => {
                    let Some(ref val) = self.data.cluster else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cluster"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct VsanUpgradeFsvmRequestType<'a> {
    cluster: &'a crate::types::structs::ManagedObjectReference,
}

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

struct VsanUpgradeFsvmRequestTypeSer<'b, 'a> {
    data: &'b VsanUpgradeFsvmRequestType<'a>,
    seq: usize,
}

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