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
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// The *SmsStorageManager* managed object (SMS) provides methods to retrieve
/// information about available storage topology, capabilities, and state.
/// 
/// SMS establishes and maintains connections with VASA providers. SMS retrieves
/// information about storage availability from the providers, and clients can use
/// the SMS API to perform the following operations.
/// - Identify VASA providers.
/// - Retrieve information about storage arrays.
/// - Identify vSphere inventory entities (hosts and datastores)
///   which are associated with external storage entities on the storage arrays.
#[derive(Clone)]
pub struct SmsStorageManager {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl SmsStorageManager {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// Get the list of storage arrays managed by all the registered VASA providers.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### provider_id
    /// List of *SmsProviderInfo.uid* for the VASA
    /// provider objects.
    ///
    /// ## Returns:
    ///
    /// List of data objects containing information about
    /// StorageArray.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: If the given providerId does not have any
    /// reference.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_array(&self, provider_id: Option<&[String]>) -> Result<Option<Vec<crate::types::structs::StorageArray>>> {
        let input = QueryArrayRequestType {provider_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryArray", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the StorageArray object that is associated with the
    /// ScsiLun.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### canonical_name
    /// *ScsiLun.canonicalName*
    /// of ScsiLun
    ///
    /// ## Returns:
    ///
    /// StorageArray for the for the ScsiLun.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_array_associated_with_lun(&self, canonical_name: &str) -> Result<Option<crate::types::structs::StorageArray>> {
        let input = QueryArrayAssociatedWithLunRequestType {canonical_name, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryArrayAssociatedWithLun", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Query Backing Storage Pools for StorageLun or StorageFileSystem.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### entity_id
    /// Unique identifier of a StorageLun or StorageFileSystem.
    ///
    /// ### entity_type
    /// Entity type of the entity specified using entityId. This can be either
    /// StorageLun or StorageFileSystem.
    ///
    /// ## Returns:
    ///
    /// Array of BackingStoragePool*BackingStoragePool* associated with specified StorageLun or StorageFileSystem.
    /// If entityId is null then API returns all the BackingStoragePools of the specified type.
    /// If both entityId and entityType are not specified then API returns all the BackingStoragePools available.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entityId does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while processing the query request.
    pub async fn query_associated_backing_storage_pool(&self, entity_id: Option<&str>, entity_type: Option<&str>) -> Result<Option<Vec<crate::types::structs::BackingStoragePool>>> {
        let input = QueryAssociatedBackingStoragePoolRequestType {entity_id, entity_type, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryAssociatedBackingStoragePool", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Query BackingStoragePools for the given set of datastores.
    /// 
    /// Available information for all types of BackingStoragePools*BackingStoragePoolType_enum*
    /// for every input datastore is returned as part of the result.
    /// More than one datastore can map to same set of BackingStoragePools.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### datastore
    /// Array containing references to *Datastore* objects.
    /// 
    /// Refers instances of *Datastore*.
    ///
    /// ## Returns:
    ///
    /// *DatastoreBackingPoolMapping*
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if any *Datastore* in the specified input array does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while processing the query request.
    pub async fn query_datastore_backing_pool_mapping(&self, datastore: &[crate::types::structs::ManagedObjectReference]) -> Result<Vec<crate::types::structs::DatastoreBackingPoolMapping>> {
        let input = QueryDatastoreBackingPoolMappingRequestType {datastore, };
        let bytes = self.client.invoke("sms", "SmsStorageManager", &self.mo_id, "QueryDatastoreBackingPoolMapping", Some(&input)).await?;
        let result: Vec<crate::types::structs::DatastoreBackingPoolMapping> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Get the capability for the given datastore.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### datastore
    /// reference to *Datastore*
    /// 
    /// Refers instance of *Datastore*.
    ///
    /// ## Returns:
    ///
    /// A data object containing information about StorageCapability.
    /// If the VMFS datastore have heterogeneous Luns (in case of VMFS extends),
    /// *StorageCapability.description* will be empty.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_datastore_capability(&self, datastore: &crate::types::structs::ManagedObjectReference) -> Result<Option<crate::types::structs::StorageCapability>> {
        let input = QueryDatastoreCapabilityRequestType {datastore, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryDatastoreCapability", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Deprecated as of SMS API 3.0, use *SmsStorageManager.QueryDrsMigrationCapabilityForPerformanceEx*.
    /// 
    /// Query the provider to figure out whether Storage DRS should
    /// migrate VMDKs between the two given datastores.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### src_datastore
    /// Reference to the source *Datastore*
    /// 
    /// Refers instance of *Datastore*.
    ///
    /// ### dst_datastore
    /// Reference to the destination *Datastore*
    /// 
    /// Refers instance of *Datastore*.
    ///
    /// ## Returns:
    ///
    /// true if VM migration is recommended from srcDatastore
    /// to dstDatastore.
    /// false if VM migration is not recommended from
    /// srcDatastore to dstDatastore.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_drs_migration_capability_for_performance(&self, src_datastore: &crate::types::structs::ManagedObjectReference, dst_datastore: &crate::types::structs::ManagedObjectReference) -> Result<bool> {
        let input = QueryDrsMigrationCapabilityForPerformanceRequestType {src_datastore, dst_datastore, };
        let bytes = self.client.invoke("sms", "SmsStorageManager", &self.mo_id, "QueryDrsMigrationCapabilityForPerformance", Some(&input)).await?;
        let result: bool = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of SMS API 5.0.
    /// 
    /// Query available VASA providers for I/O performance based migration recommendations
    /// for all pair combinations of the given set of datastores.
    /// 
    /// Datastore pairs for which
    /// a recommendation cannot be obtained are not included in the result.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### datastore
    /// Array containing references to *Datastore* objects.
    /// 
    /// Refers instances of *Datastore*.
    ///
    /// ## Returns:
    ///
    /// *DrsMigrationCapabilityResult*
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if any *Datastore* in the specified input array does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while processing the query request.
    pub async fn query_drs_migration_capability_for_performance_ex(&self, datastore: &[crate::types::structs::ManagedObjectReference]) -> Result<crate::types::structs::DrsMigrationCapabilityResult> {
        let input = QueryDrsMigrationCapabilityForPerformanceExRequestType {datastore, };
        let bytes = self.client.invoke("sms", "SmsStorageManager", &self.mo_id, "QueryDrsMigrationCapabilityForPerformanceEx", Some(&input)).await?;
        let result: crate::types::structs::DrsMigrationCapabilityResult = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Query for fault domains based on the query spec.
    /// 
    /// If spec is null, SMS
    /// will return all the root fault domains only.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### filter
    /// spec for the query operation.
    ///
    /// ## Returns:
    ///
    /// all the fault domains based on the query spec.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if invalid input is provided.
    /// 
    /// ***NotFound***: if the specified providerId in the spec does not exist
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while processing the
    /// query request.
    pub async fn query_fault_domain(&self, filter: Option<&crate::types::structs::FaultDomainFilter>) -> Result<Option<Vec<Box<dyn crate::types::traits::FaultDomainIdTrait>>>> {
        let input = QueryFaultDomainRequestType {filter, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryFaultDomain", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the StorageFileSystem data objects for the Array.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// List of data objects containing information about
    /// StorageFileSystem.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_file_system_associated_with_array(&self, array_id: &str) -> Result<Option<Vec<crate::types::structs::StorageFileSystem>>> {
        let input = QueryFileSystemAssociatedWithArrayRequestType {array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryFileSystemAssociatedWithArray", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get HostSystem managed entities that share the StorageLun.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### scsi_3_id
    /// *StorageLun.uuid* for the StorageLun
    /// object.
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// List of HostSystems.
    /// 
    /// Refers instances of *HostSystem*.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_host_associated_with_lun(&self, scsi_3_id: &str, array_id: &str) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let input = QueryHostAssociatedWithLunRequestType {scsi_3_id, array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryHostAssociatedWithLun", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the list of StorageLun data objects that for the Array.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// List of data object containing information about
    /// StorageLun.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_lun_associated_with_array(&self, array_id: &str) -> Result<Option<Vec<crate::types::structs::StorageLun>>> {
        let input = QueryLunAssociatedWithArrayRequestType {array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryLunAssociatedWithArray", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the StorageLun data objects that are associated with StoragePort.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### port_id
    /// *StoragePort.uuid* for the StoragePort
    /// object.
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// List of data objects containing information about
    /// StorageLun.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_lun_associated_with_port(&self, port_id: &str, array_id: &str) -> Result<Option<Vec<crate::types::structs::StorageLun>>> {
        let input = QueryLunAssociatedWithPortRequestType {port_id, array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryLunAssociatedWithPort", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get NFS datastore managed entity that are associated with
    /// StorageFileSystem.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### file_system_id
    /// *StorageFileSystem.uuid* for the
    /// StorageFileSystem object
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// Nas datastore for the storage file system id.
    /// 
    /// Refers instance of *Datastore*.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_nfs_datastore_associated_with_file_system(&self, file_system_id: &str, array_id: &str) -> Result<Option<crate::types::structs::ManagedObjectReference>> {
        let input = QueryNfsDatastoreAssociatedWithFileSystemRequestType {file_system_id, array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryNfsDatastoreAssociatedWithFileSystem", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the StoragePort data objects that are associated with Array.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// List of data objects containing information about
    /// StoragePort.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_port_associated_with_array(&self, array_id: &str) -> Result<Option<Vec<Box<dyn crate::types::traits::StoragePortTrait>>>> {
        let input = QueryPortAssociatedWithArrayRequestType {array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryPortAssociatedWithArray", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the StoragePort data object that is associated with LUN.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### scsi_3_id
    /// *StorageLun.uuid* for the StorageLun
    /// object.
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// A data object containing information about StoragePort.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_port_associated_with_lun(&self, scsi_3_id: &str, array_id: &str) -> Result<Option<Box<dyn crate::types::traits::StoragePortTrait>>> {
        let input = QueryPortAssociatedWithLunRequestType {scsi_3_id, array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryPortAssociatedWithLun", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the StoragePort data objects that are associated with Processor.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### processor_id
    /// *StorageProcessor.uuid* for the
    /// StorageProcessor object.
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// List of data objects containing information about
    /// StoragePort.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_port_associated_with_processor(&self, processor_id: &str, array_id: &str) -> Result<Option<Vec<Box<dyn crate::types::traits::StoragePortTrait>>>> {
        let input = QueryPortAssociatedWithProcessorRequestType {processor_id, array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryPortAssociatedWithProcessor", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the StorageProcessor data objects that are associated with Array.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// List of data objects containing information about
    /// StorageProcessor.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_processor_associated_with_array(&self, array_id: &str) -> Result<Option<Vec<crate::types::structs::StorageProcessor>>> {
        let input = QueryProcessorAssociatedWithArrayRequestType {array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryProcessorAssociatedWithArray", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get the list of Providers that are currently registered
    /// with StorageManager.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Returns:
    ///
    /// List of Providers.
    /// 
    /// Refers instances of *SmsProvider*.
    ///
    /// ## Errors:
    ///
    /// ***QueryExecutionFault***: if an error is encountered while processing the
    /// query request.
    pub async fn query_provider(&self) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryProvider", None).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Query for replication group details based on the query filter spec.
    /// 
    /// The replication
    /// group id list in the filter spec cannot be null or empty.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### rg_filter
    /// -
    ///
    /// ## Returns:
    ///
    /// An array of *GroupOperationResult* elements.
    /// The length of the result array must be the same as the input.
    /// In the result array, each entry is either a
    /// *QueryReplicationGroupSuccessResult* (for success), or a
    /// *GroupErrorResult* (for failure).
    /// 
    /// The following fault may be set in error result entry:
    /// - *NotFound* if the replication group cannot be found.
    /// - *ProviderUnavailable* if the provider for the entity is temporarily unavailable.
    /// - *InactiveProvider* if the provider for the entity is not active.
    /// - *ProviderBusy* if the provider for the entity is busy.
    /// - *NotImplemented* if the provider does not implement this function.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if *ReplicationGroupFilter.groupId* is null or empty.
    /// 
    /// ***ServiceNotInitialized***: if SMS service is not initialized.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while processing the query request.
    pub async fn query_replication_group_info(&self, rg_filter: &crate::types::structs::ReplicationGroupFilter) -> Result<Option<Vec<Box<dyn crate::types::traits::GroupOperationResultTrait>>>> {
        let input = QueryReplicationGroupInfoRequestType {rg_filter, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryReplicationGroupInfo", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Query storage containers that are retrieved from VASA providers.
    /// 
    /// Stretched container with
    /// UNREPORTED sync status is not included in returned result.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### container_spec
    /// *StorageContainerSpec*
    ///
    /// ## Returns:
    ///
    /// *StorageContainerResult*
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the input provided as part of *StorageContainerSpec* is not found.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while processing the query request.
    pub async fn query_storage_container(&self, container_spec: Option<&crate::types::structs::StorageContainerSpec>) -> Result<Option<crate::types::structs::StorageContainerResult>> {
        let input = QueryStorageContainerRequestType {container_spec, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryStorageContainer", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get VMFS Datastore managed entity that are associated with
    /// StorageLun.
    /// 
    /// ***Required privileges:*** StorageViews.View
    ///
    /// ## Parameters:
    ///
    /// ### scsi_3_id
    /// *StorageLun.uuid* for the StorageLun object
    ///
    /// ### array_id
    /// *StorageArray.uuid* for the StorageArray
    /// object.
    ///
    /// ## Returns:
    ///
    /// Vmfs datastore for the file system id.
    /// 
    /// Refers instance of *Datastore*.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***QueryExecutionFault***: if an error is encountered while
    /// processing the query request.
    pub async fn query_vmfs_datastore_associated_with_lun(&self, scsi_3_id: &str, array_id: &str) -> Result<Option<crate::types::structs::ManagedObjectReference>> {
        let input = QueryVmfsDatastoreAssociatedWithLunRequestType {scsi_3_id, array_id, };
        let bytes_opt = self.client.invoke_optional("sms", "SmsStorageManager", &self.mo_id, "QueryVmfsDatastoreAssociatedWithLun", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// SMS pushes the latest CA root certificates and CRLs to all registered VASA providers.
    /// 
    /// ***Required privileges:*** StorageViews.ConfigureService
    ///
    /// ## Parameters:
    ///
    /// ### provider_id
    /// *SmsProviderInfo.uid* for providers
    ///
    /// ## Returns:
    ///
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***NotFound***: if there exists no provider for a *SmsProviderInfo.uid* in providerId
    /// 
    /// ***InvalidArgument***: if a *SmsProviderInfo.uid* in providerId is invalid.
    /// 
    /// ***CertificateRefreshFailed***: if an error is encountered while refreshing
    /// root certificates and CRLs for any provider.
    pub async fn sms_refresh_ca_certificates_and_cr_ls_task(&self, provider_id: Option<&[String]>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = SmsRefreshCaCertificatesAndCrLsRequestType {provider_id, };
        let bytes = self.client.invoke("sms", "SmsStorageManager", &self.mo_id, "SmsRefreshCACertificatesAndCRLs_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Register the provider and issue a sync operation on it.
    /// 
    /// ***Required privileges:*** StorageViews.ConfigureService
    ///
    /// ## Parameters:
    ///
    /// ### provider_spec
    /// *SmsProviderSpec*
    /// containing parameters needed to register the
    /// provider
    ///
    /// ## Returns:
    ///
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if invalid input is provided.
    /// 
    /// ***AlreadyExists***: if the provider already exists.
    /// 
    /// ***ProviderRegistrationFault***: if an error is encountered during the
    /// registration operation. For instance, *IncorrectUsernamePassword*
    /// is thrown if the login credentials are incorrect. *CertificateNotTrusted*
    /// is thrown if the provider identifies itself with an untrusted certificate.
    pub async fn register_provider_task(&self, provider_spec: &dyn crate::types::traits::SmsProviderSpecTrait) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = RegisterProviderRequestType {provider_spec, };
        let bytes = self.client.invoke("sms", "SmsStorageManager", &self.mo_id, "RegisterProvider_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Unregister the provider.
    /// 
    /// ***Required privileges:*** StorageViews.ConfigureService
    ///
    /// ## Parameters:
    ///
    /// ### provider_id
    /// *SmsProviderInfo.uid* for
    /// the provider
    ///
    /// ## Returns:
    ///
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if invalid input is provided.
    /// 
    /// ***NotFound***: if the specified entity does not exist.
    /// 
    /// ***ProviderUnregistrationFault***: if provider service is not available or
    /// any exception is thrown by the VASA provider
    /// during unregister provider.
    pub async fn unregister_provider_task(&self, provider_id: &str) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = UnregisterProviderRequestType {provider_id, };
        let bytes = self.client.invoke("sms", "SmsStorageManager", &self.mo_id, "UnregisterProvider_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Upgrade VASA Provider registered to vCenter/SMS to maximum common version supported by both
    /// VASA Provider and SMS.
    /// 
    /// ***Required privileges:*** StorageViews.ConfigureService
    ///
    /// ## Parameters:
    ///
    /// ### upgrade_spec
    /// *VASAProviderUpgradeSpec* containing parameter to upgrade the
    /// VASA Provider. If spec is for non VVOL VASA Provider, then exception is thrown.
    ///
    /// ## Returns:
    ///
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***SmsFault***: If there is any error encountered while processing request
    pub async fn upgrade_vasa_provider_task(&self, upgrade_spec: &crate::types::structs::VasaProviderUpgradeSpec) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = UpgradeVasaProviderRequestType {upgrade_spec, };
        let bytes = self.client.invoke("sms", "SmsStorageManager", &self.mo_id, "UpgradeVASAProvider_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
}
struct QueryArrayRequestType<'a> {
    provider_id: Option<&'a [String]>,
}

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

struct QueryArrayRequestTypeSer<'b, 'a> {
    data: &'b QueryArrayRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryArrayRequestTypeSer<'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"), &"QueryArrayRequestType")),
                1 => {
                    let Some(ref val) = self.data.provider_id else { continue; };
                    return Some((std::borrow::Cow::Borrowed("providerId"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct QueryArrayAssociatedWithLunRequestType<'a> {
    canonical_name: &'a str,
}

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

struct QueryArrayAssociatedWithLunRequestTypeSer<'b, 'a> {
    data: &'b QueryArrayAssociatedWithLunRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryArrayAssociatedWithLunRequestTypeSer<'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"), &"QueryArrayAssociatedWithLunRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("canonicalName"), &self.data.canonical_name as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryAssociatedBackingStoragePoolRequestType<'a> {
    entity_id: Option<&'a str>,
    entity_type: Option<&'a str>,
}

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

struct QueryAssociatedBackingStoragePoolRequestTypeSer<'b, 'a> {
    data: &'b QueryAssociatedBackingStoragePoolRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryAssociatedBackingStoragePoolRequestTypeSer<'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"), &"QueryAssociatedBackingStoragePoolRequestType")),
                1 => {
                    let Some(ref val) = self.data.entity_id else { continue; };
                    return Some((std::borrow::Cow::Borrowed("entityId"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.entity_type else { continue; };
                    return Some((std::borrow::Cow::Borrowed("entityType"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct QueryDatastoreBackingPoolMappingRequestType<'a> {
    datastore: &'a [crate::types::structs::ManagedObjectReference],
}

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

struct QueryDatastoreBackingPoolMappingRequestTypeSer<'b, 'a> {
    data: &'b QueryDatastoreBackingPoolMappingRequestType<'a>,
    seq: usize,
}

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

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

struct QueryDatastoreCapabilityRequestTypeSer<'b, 'a> {
    data: &'b QueryDatastoreCapabilityRequestType<'a>,
    seq: usize,
}

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

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

struct QueryDrsMigrationCapabilityForPerformanceRequestTypeSer<'b, 'a> {
    data: &'b QueryDrsMigrationCapabilityForPerformanceRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryDrsMigrationCapabilityForPerformanceRequestTypeSer<'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"), &"QueryDrsMigrationCapabilityForPerformanceRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("srcDatastore"), &self.data.src_datastore as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("dstDatastore"), &self.data.dst_datastore as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryDrsMigrationCapabilityForPerformanceExRequestType<'a> {
    datastore: &'a [crate::types::structs::ManagedObjectReference],
}

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

struct QueryDrsMigrationCapabilityForPerformanceExRequestTypeSer<'b, 'a> {
    data: &'b QueryDrsMigrationCapabilityForPerformanceExRequestType<'a>,
    seq: usize,
}

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

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

struct QueryFaultDomainRequestTypeSer<'b, 'a> {
    data: &'b QueryFaultDomainRequestType<'a>,
    seq: usize,
}

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

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

struct QueryFileSystemAssociatedWithArrayRequestTypeSer<'b, 'a> {
    data: &'b QueryFileSystemAssociatedWithArrayRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryFileSystemAssociatedWithArrayRequestTypeSer<'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"), &"QueryFileSystemAssociatedWithArrayRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryHostAssociatedWithLunRequestType<'a> {
    scsi_3_id: &'a str,
    array_id: &'a str,
}

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

struct QueryHostAssociatedWithLunRequestTypeSer<'b, 'a> {
    data: &'b QueryHostAssociatedWithLunRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryHostAssociatedWithLunRequestTypeSer<'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"), &"QueryHostAssociatedWithLunRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("scsi3Id"), &self.data.scsi_3_id as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryLunAssociatedWithArrayRequestType<'a> {
    array_id: &'a str,
}

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

struct QueryLunAssociatedWithArrayRequestTypeSer<'b, 'a> {
    data: &'b QueryLunAssociatedWithArrayRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryLunAssociatedWithArrayRequestTypeSer<'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"), &"QueryLunAssociatedWithArrayRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryLunAssociatedWithPortRequestType<'a> {
    port_id: &'a str,
    array_id: &'a str,
}

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

struct QueryLunAssociatedWithPortRequestTypeSer<'b, 'a> {
    data: &'b QueryLunAssociatedWithPortRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryLunAssociatedWithPortRequestTypeSer<'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"), &"QueryLunAssociatedWithPortRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("portId"), &self.data.port_id as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryNfsDatastoreAssociatedWithFileSystemRequestType<'a> {
    file_system_id: &'a str,
    array_id: &'a str,
}

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

struct QueryNfsDatastoreAssociatedWithFileSystemRequestTypeSer<'b, 'a> {
    data: &'b QueryNfsDatastoreAssociatedWithFileSystemRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryNfsDatastoreAssociatedWithFileSystemRequestTypeSer<'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"), &"QueryNfsDatastoreAssociatedWithFileSystemRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("fileSystemId"), &self.data.file_system_id as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryPortAssociatedWithArrayRequestType<'a> {
    array_id: &'a str,
}

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

struct QueryPortAssociatedWithArrayRequestTypeSer<'b, 'a> {
    data: &'b QueryPortAssociatedWithArrayRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryPortAssociatedWithArrayRequestTypeSer<'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"), &"QueryPortAssociatedWithArrayRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryPortAssociatedWithLunRequestType<'a> {
    scsi_3_id: &'a str,
    array_id: &'a str,
}

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

struct QueryPortAssociatedWithLunRequestTypeSer<'b, 'a> {
    data: &'b QueryPortAssociatedWithLunRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryPortAssociatedWithLunRequestTypeSer<'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"), &"QueryPortAssociatedWithLunRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("scsi3Id"), &self.data.scsi_3_id as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryPortAssociatedWithProcessorRequestType<'a> {
    processor_id: &'a str,
    array_id: &'a str,
}

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

struct QueryPortAssociatedWithProcessorRequestTypeSer<'b, 'a> {
    data: &'b QueryPortAssociatedWithProcessorRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryPortAssociatedWithProcessorRequestTypeSer<'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"), &"QueryPortAssociatedWithProcessorRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("processorId"), &self.data.processor_id as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryProcessorAssociatedWithArrayRequestType<'a> {
    array_id: &'a str,
}

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

struct QueryProcessorAssociatedWithArrayRequestTypeSer<'b, 'a> {
    data: &'b QueryProcessorAssociatedWithArrayRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryProcessorAssociatedWithArrayRequestTypeSer<'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"), &"QueryProcessorAssociatedWithArrayRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryReplicationGroupInfoRequestType<'a> {
    rg_filter: &'a crate::types::structs::ReplicationGroupFilter,
}

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

struct QueryReplicationGroupInfoRequestTypeSer<'b, 'a> {
    data: &'b QueryReplicationGroupInfoRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryReplicationGroupInfoRequestTypeSer<'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"), &"QueryReplicationGroupInfoRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("rgFilter"), &self.data.rg_filter as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryStorageContainerRequestType<'a> {
    container_spec: Option<&'a crate::types::structs::StorageContainerSpec>,
}

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

struct QueryStorageContainerRequestTypeSer<'b, 'a> {
    data: &'b QueryStorageContainerRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryStorageContainerRequestTypeSer<'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"), &"QueryStorageContainerRequestType")),
                1 => {
                    let Some(ref val) = self.data.container_spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("containerSpec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct QueryVmfsDatastoreAssociatedWithLunRequestType<'a> {
    scsi_3_id: &'a str,
    array_id: &'a str,
}

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

struct QueryVmfsDatastoreAssociatedWithLunRequestTypeSer<'b, 'a> {
    data: &'b QueryVmfsDatastoreAssociatedWithLunRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryVmfsDatastoreAssociatedWithLunRequestTypeSer<'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"), &"QueryVmfsDatastoreAssociatedWithLunRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("scsi3Id"), &self.data.scsi_3_id as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("arrayId"), &self.data.array_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct SmsRefreshCaCertificatesAndCrLsRequestType<'a> {
    provider_id: Option<&'a [String]>,
}

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

struct SmsRefreshCaCertificatesAndCrLsRequestTypeSer<'b, 'a> {
    data: &'b SmsRefreshCaCertificatesAndCrLsRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for SmsRefreshCaCertificatesAndCrLsRequestTypeSer<'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"), &"SmsRefreshCACertificatesAndCRLsRequestType")),
                1 => {
                    let Some(ref val) = self.data.provider_id else { continue; };
                    return Some((std::borrow::Cow::Borrowed("providerId"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct RegisterProviderRequestType<'a> {
    provider_spec: &'a dyn crate::types::traits::SmsProviderSpecTrait,
}

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

struct RegisterProviderRequestTypeSer<'b, 'a> {
    data: &'b RegisterProviderRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RegisterProviderRequestTypeSer<'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"), &"RegisterProviderRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("providerSpec"), &self.data.provider_spec as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct UnregisterProviderRequestType<'a> {
    provider_id: &'a str,
}

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

struct UnregisterProviderRequestTypeSer<'b, 'a> {
    data: &'b UnregisterProviderRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for UnregisterProviderRequestTypeSer<'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"), &"UnregisterProviderRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("providerId"), &self.data.provider_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct UpgradeVasaProviderRequestType<'a> {
    upgrade_spec: &'a crate::types::structs::VasaProviderUpgradeSpec,
}

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

struct UpgradeVasaProviderRequestTypeSer<'b, 'a> {
    data: &'b UpgradeVasaProviderRequestType<'a>,
    seq: usize,
}

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