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
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// The *HostProfileManager* provides access to a list of
/// *HostProfile*s and it defines methods to manipulate
/// profiles and *AnswerFile*s.
#[derive(Clone)]
pub struct HostProfileManager {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl HostProfileManager {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// The task for applying host configuration on a list of hosts.
    /// 
    /// This is the
    /// batch version of <code>applyHostConfiguration</code>. The implementation
    /// of this method will:
    /// When a host is in a DRS cluster but doesn't satisfy the state requirement
    /// such as that the host is not in the required maintenance mode, this
    /// method uses DRS feature to put the host into maintenance mode.
    /// This method will apply a host profile to a stateful host or stateless
    /// host; or apply a host profile to a stateless host by reboot.
    /// After a host is reboot, a check compliance is done to update the latest
    /// compliance status.
    ///
    /// ## Parameters:
    ///
    /// ### apply_config_specs
    /// An array of
    /// *ApplyHostProfileConfigurationSpec*
    /// objects. Each applyConfigSpecs object contains the data objects
    /// required to remediate a host. The API caller should expand
    /// a cluster to all its hosts for the purpose of providing the
    /// required data object for configuration apply of each host.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation. If the task is successful, the
    /// *Task*.*Task.info*.*TaskInfo.result*
    /// property is an array of
    /// *ApplyHostProfileConfigurationResult*
    /// objects. Each
    /// *ApplyHostProfileConfigurationResult*
    /// is for each host in the provided host list.
    /// 
    /// Refers instance of *Task*.
    pub async fn apply_entities_config_task(&self, apply_config_specs: Option<&[crate::types::structs::ApplyHostProfileConfigurationSpec]>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ApplyEntitiesConfigRequestType {apply_config_specs, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "ApplyEntitiesConfig_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Apply the configuration to the host.
    /// 
    /// If you specify any user input,
    /// the configuration will be saved in the *AnswerFile*
    /// associated with the host. If there is no answer file, the Profile Engine
    /// will create one.
    ///
    /// ## Parameters:
    ///
    /// ### host
    /// Host to be updated. User must have sufficient credentials and privileges
    /// to satisfy the contents of the <code>configSpec</code>.
    /// 
    /// Refers instance of *HostSystem*.
    ///
    /// ### config_spec
    /// Set of configuration changes to be applied to the host.
    /// The changes are returned by the
    /// *HostProfile*.*HostProfile.ExecuteHostProfile*
    /// method in the
    /// *ProfileExecuteResult*.*ProfileExecuteResult.configSpec*
    /// property.
    ///
    /// ### user_input
    /// Additional host-specific data to be applied to the host.
    /// This data is the complete list of deferred parameters verified by the
    /// *HostProfile*.*HostProfile.ExecuteHostProfile*
    /// method, contained in the *ProfileExecuteResult* object
    /// returned by the method.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: if the host is not in maintenance mode and the
    /// configuration specification requires it.
    /// 
    /// ***HostConfigFailed***: if the ESX Server cannot apply the configuration changes.
    pub async fn apply_host_config_task(&self, host: &crate::types::structs::ManagedObjectReference, config_spec: &crate::types::structs::HostConfigSpec, user_input: Option<&[crate::types::structs::ProfileDeferredPolicyOptionParameter]>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ApplyHostConfigRequestType {host, config_spec, user_input, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "ApplyHostConfig_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Check the validity of the answer files for the specified hosts.
    /// 
    /// The Profile Engine uses the profile associated with a host to check
    /// the answer file.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### host
    /// Set of hosts for which the answer file status will be checked.
    /// 
    /// Refers instances of *HostSystem*.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation. If the task is successful, the
    /// *Task*.*Task.info*.*TaskInfo.result*
    /// property contains a list of *AnswerFileStatusResult* objects.
    /// 
    /// Refers instance of *Task*.
    pub async fn check_answer_file_status_task(&self, host: &[crate::types::structs::ManagedObjectReference]) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = CheckAnswerFileStatusRequestType {host, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "CheckAnswerFileStatus_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Composes (merge, replace, delete, disable)
    /// the selected configurations into the target host profiles.
    /// 
    /// ***Required privileges:*** Profile.Edit
    ///
    /// ## Parameters:
    ///
    /// ### source
    /// Refers instance of *Profile*.
    ///
    /// ### targets
    /// Refers instances of *Profile*.
    ///
    /// ### to_be_merged
    /// -
    ///
    /// ### to_be_replaced_with
    /// -
    ///
    /// ### to_be_deleted
    /// -
    ///
    /// ### enable_status_to_be_copied
    /// -
    ///
    /// ## Returns:
    ///
    /// This method will returns a *Task* object with which to
    /// monitor the operation. The
    /// *Task*.*Task.info*.*TaskInfo.result*
    /// will contain a
    /// *HostProfileManagerCompositionResult*
    /// object containing the status of the operation, and details about
    /// any composition errors.
    /// The definitions of all the parameters are same as those in
    /// *HostProfileManager.ValidateHostProfileComposition_Task*.
    /// 
    /// Refers instance of *Task*.
    pub async fn composite_host_profile_task(&self, source: &crate::types::structs::ManagedObjectReference, targets: Option<&[crate::types::structs::ManagedObjectReference]>, to_be_merged: Option<&crate::types::structs::HostApplyProfile>, to_be_replaced_with: Option<&crate::types::structs::HostApplyProfile>, to_be_deleted: Option<&crate::types::structs::HostApplyProfile>, enable_status_to_be_copied: Option<&crate::types::structs::HostApplyProfile>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = CompositeHostProfileRequestType {source, targets, to_be_merged, to_be_replaced_with, to_be_deleted, enable_status_to_be_copied, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "CompositeHostProfile_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Create a default subprofile of a given type (for example, a
    /// *VirtualSwitchProfile*).
    /// 
    /// After you create
    /// the subprofile, you can add it to a configuration specification
    /// and update the host profile:
    /// - Call the <code>CreateDefaultProfile</code> method.
    /// - Create a *HostProfileCompleteConfigSpec* object.
    /// - Copy the existing profile from the host configuration information
    ///   (*HostProfile*.*Profile.config*.*HostProfileConfigInfo.applyProfile*) to the configuration specification.
    /// - Add the new subprofile to the configuration specification. For example,
    ///   if you create a <code>VirtualSwitchProfile</code>, you would add it to the list
    ///   of virtual switches in the network profile for the configuration specification
    ///   (*NetworkProfile*.*NetworkProfile.vswitch*\[\]).
    /// - Call *HostProfile*.*HostProfile.UpdateHostProfile*
    ///   to save the new subprofile.  
    ///   
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### profile_type
    /// Type of profile to create. The profile types
    /// are system-defined
    /// (*ApplyProfile*.*ApplyProfile.profileTypeName*).
    ///
    /// ### profile_type_name
    /// If specified, the method returns a profile object
    /// containing data for the named profile. The type name does not have
    /// to be system-defined. A user-defined profile can include various
    /// dynamically-defined profiles.
    ///
    /// ### profile
    /// Base profile used during the operation.
    /// 
    /// Refers instance of *Profile*.
    ///
    /// ## Returns:
    ///
    /// Derived subprofile of type <code>profileType</code>.
    pub async fn create_default_profile(&self, profile_type: &str, profile_type_name: Option<&str>, profile: Option<&crate::types::structs::ManagedObjectReference>) -> Result<Box<dyn crate::types::traits::ApplyProfileTrait>> {
        let input = CreateDefaultProfileRequestType {profile_type, profile_type_name, profile, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "CreateDefaultProfile", Some(&input)).await?;
        let result: Box<dyn crate::types::traits::ApplyProfileTrait> = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Create a profile from the specified CreateSpec.
    /// 
    /// ***Required privileges:*** Profile.Create
    ///
    /// ## Parameters:
    ///
    /// ### create_spec
    /// Specification for the profile being created.
    /// Usually a derived class CreateSpec can be used to create the Profile.
    ///
    /// ## Returns:
    ///
    /// Profile created from the specified createSpec.
    /// 
    /// Refers instance of *Profile*.
    ///
    /// ## Errors:
    ///
    /// ***DuplicateName***: If a profile with the specified name already
    /// exists.
    /// 
    /// ***InvalidProfileReferenceHost***: if the specified reference host is
    /// incompatible or no reference host has been specified.
    pub async fn create_profile(&self, create_spec: &dyn crate::types::traits::ProfileCreateSpecTrait) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = CreateProfileRequestType {create_spec, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "CreateProfile", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Export a host's answer file into a serialized form.
    /// 
    /// The method returns a string
    /// that contains only the list of user input options.
    /// See *AnswerFile*.*AnswerFile.userInput*.
    /// 
    /// ***Required privileges:*** Profile.Export
    ///
    /// ## Parameters:
    ///
    /// ### host
    /// Host with which the answer file is associated.
    /// 
    /// Refers instance of *HostSystem*.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation. If the task is successful, the
    /// *Task*.*Task.info*.*TaskInfo.result*
    /// property is a string that contains a serialized form of the answer file.
    /// 
    /// Refers instance of *Task*.
    pub async fn export_answer_file_task(&self, host: &crate::types::structs::ManagedObjectReference) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ExportAnswerFileRequestType {host, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "ExportAnswerFile_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Get the profile(s) to which this entity is associated.
    /// 
    /// The list of profiles will only include profiles known to this
    /// profileManager.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### entity
    /// Entity for which profile is being looked up.
    /// 
    /// Refers instance of *ManagedEntity*.
    ///
    /// ## Returns:
    ///
    /// Refers instances of *Profile*.
    pub async fn find_associated_profile(&self, entity: &crate::types::structs::ManagedObjectReference) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let input = FindAssociatedProfileRequestType {entity, };
        let bytes_opt = self.client.invoke_optional("", "HostProfileManager", &self.mo_id, "FindAssociatedProfile", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Deprecated as of vSphere API 6.0 use
    /// *HostProfileManager.GenerateHostProfileTaskList_Task*.
    /// 
    /// Generate a list of configuration tasks that will be performed on the
    /// host during HostProfile application.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### config_spec
    /// ConfigSpec which was proposed by
    /// *HostProfile.ExecuteHostProfile* method.
    ///
    /// ### host
    /// Host on which the HostProfile application needs to be
    /// carried out.
    /// 
    /// Refers instance of *HostSystem*.
    ///
    /// ## Returns:
    ///
    /// List of Configuration tasks.
    pub async fn generate_config_task_list(&self, config_spec: &crate::types::structs::HostConfigSpec, host: &crate::types::structs::ManagedObjectReference) -> Result<crate::types::structs::HostProfileManagerConfigTaskList> {
        let input = GenerateConfigTaskListRequestType {config_spec, host, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "GenerateConfigTaskList", Some(&input)).await?;
        let result: crate::types::structs::HostProfileManagerConfigTaskList = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// This method generates *ApplyHostProfileConfigurationSpec* data object
    /// for each host which can be passed as input to
    /// *HostProfileManager.ApplyEntitiesConfig_Task*
    /// to configure that host.
    /// 
    /// For each host, this method goes through two stages,
    /// *HostProfile.ExecuteHostProfile* stage
    /// *HostProfileManager.GenerateHostProfileTaskList_Task* stage. If the
    /// *HostProfile.ExecuteHostProfile* stage completes
    /// successfully then the method invokes the
    /// *HostProfileManager.GenerateHostProfileTaskList_Task*
    /// stage to generate the list of configuration tasks that are needed
    /// to configure the host.
    /// This method will return a task to monitor the progress of the operation.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### hosts_info
    /// List of host data for which configuration task list
    /// needs to be generated. The
    /// *StructuredCustomizations.customizations* value should be
    /// provided only if the host customization data for that host is
    /// invalid. If this property is not provided, the API will use the
    /// host customization data stored in VC and generate task list.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation. If the task is successful, the
    /// *Task*.*Task.info*.*TaskInfo.result*
    /// property is a
    /// *ApplyHostProfileConfigurationSpec* object.
    /// 
    /// Refers instance of *Task*.
    pub async fn generate_host_config_task_spec_task(&self, hosts_info: Option<&[crate::types::structs::StructuredCustomizations]>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = GenerateHostConfigTaskSpecRequestType {hosts_info, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "GenerateHostConfigTaskSpec_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Generate a list of configuration tasks that will be performed on the
    /// host during HostProfile application.
    /// 
    /// This differs from the
    /// *HostProfileManager.GenerateConfigTaskList* method in
    /// that it returns a task to monitor the progress of the operation.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### config_spec
    /// ConfigSpec which was proposed by
    /// *HostProfile.ExecuteHostProfile* method.
    ///
    /// ### host
    /// Host on which the HostProfile application needs to be
    /// carried out.
    /// 
    /// Refers instance of *HostSystem*.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation. If the task is successful, the
    /// *Task*.*Task.info*.*TaskInfo.result*
    /// property is a *HostProfileManagerConfigTaskList*
    /// object.
    /// 
    /// Refers instance of *Task*.
    pub async fn generate_host_profile_task_list_task(&self, config_spec: &crate::types::structs::HostConfigSpec, host: &crate::types::structs::ManagedObjectReference) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = GenerateHostProfileTaskListRequestType {config_spec, host, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "GenerateHostProfileTaskList_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Returns the status of the answer files associated with specified hosts.
    /// 
    /// This method returns the most recent status determined by
    /// *HostProfileManager.CheckAnswerFileStatus_Task*.
    /// See *HostProfileManagerAnswerFileStatus_enum* for valid values.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### host
    /// The hosts the answer file is associated with.
    /// 
    /// Refers instances of *HostSystem*.
    ///
    /// ## Returns:
    ///
    /// List of answer file status objects.
    pub async fn query_answer_file_status(&self, host: &[crate::types::structs::ManagedObjectReference]) -> Result<Option<Vec<crate::types::structs::AnswerFileStatusResult>>> {
        let input = QueryAnswerFileStatusRequestType {host, };
        let bytes_opt = self.client.invoke_optional("", "HostProfileManager", &self.mo_id, "QueryAnswerFileStatus", 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 Metadata information for the policyNames.
    /// 
    /// PolicyNames are available with the defaultProfile obtained by invoking the
    /// method createDefaultProfile.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### policy_name
    /// Retrieve metadata for the specified policyNames.
    /// If policyName is not specified, metadata for all policies will be returned.
    ///
    /// ### profile
    /// Base profile whose context needs to be used during the operation
    /// 
    /// Refers instance of *Profile*.
    ///
    /// ## Returns:
    ///
    /// The metadata information for the policy.
    pub async fn query_policy_metadata(&self, policy_name: Option<&[String]>, profile: Option<&crate::types::structs::ManagedObjectReference>) -> Result<Option<Vec<crate::types::structs::ProfilePolicyMetadata>>> {
        let input = QueryPolicyMetadataRequestType {policy_name, profile, };
        let bytes_opt = self.client.invoke_optional("", "HostProfileManager", &self.mo_id, "QueryPolicyMetadata", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Retrieve the metadata for a set of profiles.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### profile_name
    /// Names of the profiles for which metadata is requested.
    /// If not set, the method returns metadata for all the profiles.
    ///
    /// ### profile
    /// Base profile whose context needs to be used during the operation
    /// 
    /// Refers instance of *Profile*.
    ///
    /// ## Returns:
    ///
    /// List of profile metadata objects.
    pub async fn query_host_profile_metadata(&self, profile_name: Option<&[String]>, profile: Option<&crate::types::structs::ManagedObjectReference>) -> Result<Option<Vec<crate::types::structs::ProfileMetadata>>> {
        let input = QueryHostProfileMetadataRequestType {profile_name, profile, };
        let bytes_opt = self.client.invoke_optional("", "HostProfileManager", &self.mo_id, "QueryHostProfileMetadata", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Get information about the structure of the profile.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Parameters:
    ///
    /// ### profile
    /// Base profile whose context needs to be used during the operation
    /// 
    /// Refers instance of *Profile*.
    ///
    /// ## Returns:
    ///
    /// The profile structure.
    pub async fn query_profile_structure(&self, profile: Option<&crate::types::structs::ManagedObjectReference>) -> Result<crate::types::structs::ProfileProfileStructure> {
        let input = QueryProfileStructureRequestType {profile, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "QueryProfileStructure", Some(&input)).await?;
        let result: crate::types::structs::ProfileProfileStructure = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Returns the answer file associated with a particular host.
    ///
    /// ## Parameters:
    ///
    /// ### host
    /// Host with which the answer file is associated.
    /// 
    /// ***Required privileges:*** Profile.Edit
    /// 
    /// Refers instance of *HostSystem*.
    ///
    /// ## Returns:
    ///
    /// Answer file object will be returned if it exists.
    pub async fn retrieve_answer_file(&self, host: &crate::types::structs::ManagedObjectReference) -> Result<Option<crate::types::structs::AnswerFile>> {
        let input = RetrieveAnswerFileRequestType {host, };
        let bytes_opt = self.client.invoke_optional("", "HostProfileManager", &self.mo_id, "RetrieveAnswerFile", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Returns the answer file associated with a particular host, augmented
    /// with whatever answer file values are required for the supplied host
    /// profile.
    ///
    /// ## Parameters:
    ///
    /// ### host
    /// Host with which the answer file is associated.
    /// 
    /// ***Required privileges:*** Profile.Edit
    /// 
    /// Refers instance of *HostSystem*.
    ///
    /// ### apply_profile
    /// Profile configuration used to generate answer file
    ///
    /// ## Returns:
    ///
    /// Answer file object will be returned.
    pub async fn retrieve_answer_file_for_profile(&self, host: &crate::types::structs::ManagedObjectReference, apply_profile: &crate::types::structs::HostApplyProfile) -> Result<Option<crate::types::structs::AnswerFile>> {
        let input = RetrieveAnswerFileForProfileRequestType {host, apply_profile, };
        let bytes_opt = self.client.invoke_optional("", "HostProfileManager", &self.mo_id, "RetrieveAnswerFileForProfile", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// This is the batch version of
    /// vim.profile.host.ProfileManager@retrieveAnswerFile.
    /// 
    /// Returns a map that contains the hosts and their answer file data
    /// objects.
    ///
    /// ## Parameters:
    ///
    /// ### hosts
    /// Hosts with which the answer files are associated.
    /// 
    /// ***Required privileges:*** Profile.Edit
    /// 
    /// Refers instances of *HostSystem*.
    ///
    /// ## Returns:
    ///
    /// A map that contains the hosts and their answer files.
    pub async fn retrieve_host_customizations(&self, hosts: Option<&[crate::types::structs::ManagedObjectReference]>) -> Result<Option<Vec<crate::types::structs::StructuredCustomizations>>> {
        let input = RetrieveHostCustomizationsRequestType {hosts, };
        let bytes_opt = self.client.invoke_optional("", "HostProfileManager", &self.mo_id, "RetrieveHostCustomizations", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// This is the batch version of
    /// vim.profile.host.ProfileManager@retrieveAnswerFileForProfile.
    /// 
    /// Returns a map that contains the hosts and their answer files associated
    /// with these hosts, augmented with whatever answer file values are
    /// required for the supplied host profile.
    ///
    /// ## Parameters:
    ///
    /// ### hosts
    /// Hosts with which the answer files are associated.
    /// 
    /// ***Required privileges:*** Profile.Edit
    /// 
    /// Refers instances of *HostSystem*.
    ///
    /// ### apply_profile
    /// Profile configuration used to generate answer file
    ///
    /// ## Returns:
    ///
    /// A map contains the hosts and their answer files.
    pub async fn retrieve_host_customizations_for_profile(&self, hosts: Option<&[crate::types::structs::ManagedObjectReference]>, apply_profile: &crate::types::structs::HostApplyProfile) -> Result<Option<Vec<crate::types::structs::StructuredCustomizations>>> {
        let input = RetrieveHostCustomizationsForProfileRequestType {hosts, apply_profile, };
        let bytes_opt = self.client.invoke_optional("", "HostProfileManager", &self.mo_id, "RetrieveHostCustomizationsForProfile", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Update the *AnswerFile* for the specified host.
    /// 
    /// If there is no answer file associated with the host, the Profile Engine
    /// uses the answer file configuration specification to create a new one.
    /// 
    /// ***Required privileges:*** Profile.Edit
    ///
    /// ## Parameters:
    ///
    /// ### host
    /// Host with which the answer file is associated.
    /// 
    /// Refers instance of *HostSystem*.
    ///
    /// ### config_spec
    /// Host-specific configuration data. If the configuration
    /// specification does not contain any host-specific user input
    /// (<code>configSpec</code>.*AnswerFileOptionsCreateSpec.userInput*),
    /// the method does not perform any operation on the answer file.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor
    /// the operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***AnswerFileUpdateFailed***: If the answer file could not be updated.
    /// 
    /// ***InvalidArgument***: If the input parameters are incorrect.
    pub async fn update_answer_file_task(&self, host: &crate::types::structs::ManagedObjectReference, config_spec: &dyn crate::types::traits::AnswerFileCreateSpecTrait) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = UpdateAnswerFileRequestType {host, config_spec, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "UpdateAnswerFile_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Validates the proposed host profile composition.
    /// 
    /// ***Required privileges:*** Profile.Edit
    ///
    /// ## Parameters:
    ///
    /// ### source
    /// The source host profile of the configurations for
    /// composition.
    /// 
    /// Refers instance of *Profile*.
    ///
    /// ### targets
    /// The array of target host profiles that the configurations
    /// composite into.
    /// 
    /// Refers instances of *Profile*.
    ///
    /// ### to_be_merged
    /// A *HostApplyProfile* object
    /// contains the sub profiles that will be merged from the source to
    /// the target host profiles, and all the ancestors of these sub
    /// profiles. For singleton sub profile, it will be added into a
    /// target host profile if it doesn't exist in the target; otherwise,
    /// it replaces the one in the target.
    /// The member variable
    /// *ApplyProfile.toBeMerged* of these sub profiles
    /// should have a value of <code>true</code>. The member variables
    /// *ApplyProfile.toBeMerged*
    /// *ApplyProfile.toReplaceWith*,
    /// *ApplyProfile.toBeDeleted*
    /// of the ancestors should have a value of <code>false</code>.
    ///
    /// ### to_replace_with
    /// A *HostApplyProfile* object
    /// contains the sub profiles that will be used to replace the array
    /// in the target host profiles, and all the ancestors of these sub
    /// profiles.
    /// Similar to above except that the member variable
    /// *ApplyProfile.toReplaceWith*
    /// is turned on.
    ///
    /// ### to_be_deleted
    /// A *HostApplyProfile* object
    /// contains the sub profiles that will be deleted from the source
    /// **and** the target host profiles, and all the ancestors of
    /// these sub profiles.
    /// Similar to above except that the member variable
    /// *ApplyProfile.toBeDeleted*
    /// is turned on.
    ///
    /// ### enable_status_to_be_copied
    /// A *HostApplyProfile*
    /// object contains the sub profiles that the member variable
    /// *ApplyProfile.enabled* will be copied from the
    /// source host profile to all the target host profiles, and all the
    /// ancestors of these sub profiles.
    /// The member variable
    /// *ApplyProfile.copyEnableStatus*
    /// of these sub profiles is turned on. The member variable
    /// *ApplyProfile.copyEnableStatus* of the
    /// *ApplyProfile.copyEnableStatus* of the
    /// ancestors should have a value of <code>false</code>.
    ///
    /// ### error_only
    /// Indicates that the validation result for each target
    /// don't contain the source-target difference.
    ///
    /// ## Returns:
    ///
    /// This method will returns a *Task* object with which to
    /// monitor the operation. The
    /// *Task*.*Task.info*.*TaskInfo.result*
    /// will contain a
    /// *HostProfileManagerCompositionValidationResult*
    /// object containing the status of the operation, any validation errors
    /// and the validation results.
    /// 
    /// Refers instance of *Task*.
    pub async fn validate_host_profile_composition_task(&self, source: &crate::types::structs::ManagedObjectReference, targets: Option<&[crate::types::structs::ManagedObjectReference]>, to_be_merged: Option<&crate::types::structs::HostApplyProfile>, to_replace_with: Option<&crate::types::structs::HostApplyProfile>, to_be_deleted: Option<&crate::types::structs::HostApplyProfile>, enable_status_to_be_copied: Option<&crate::types::structs::HostApplyProfile>, error_only: Option<bool>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ValidateHostProfileCompositionRequestType {source, targets, to_be_merged, to_replace_with, to_be_deleted, enable_status_to_be_copied, error_only, };
        let bytes = self.client.invoke("", "HostProfileManager", &self.mo_id, "ValidateHostProfileComposition_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// A list of profiles known to this ProfileManager.
    /// 
    /// ***Required privileges:*** Profile.View
    ///
    /// ## Returns:
    ///
    /// Refers instances of *Profile*.
    pub async fn profile(&self) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostProfileManager", &self.mo_id, "profile").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
}
struct ApplyEntitiesConfigRequestType<'a> {
    apply_config_specs: Option<&'a [crate::types::structs::ApplyHostProfileConfigurationSpec]>,
}

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

struct ApplyEntitiesConfigRequestTypeSer<'b, 'a> {
    data: &'b ApplyEntitiesConfigRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ApplyEntitiesConfigRequestTypeSer<'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"), &"ApplyEntitiesConfigRequestType")),
                1 => {
                    let Some(ref val) = self.data.apply_config_specs else { continue; };
                    return Some((std::borrow::Cow::Borrowed("applyConfigSpecs"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct ApplyHostConfigRequestType<'a> {
    host: &'a crate::types::structs::ManagedObjectReference,
    config_spec: &'a crate::types::structs::HostConfigSpec,
    user_input: Option<&'a [crate::types::structs::ProfileDeferredPolicyOptionParameter]>,
}

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

struct ApplyHostConfigRequestTypeSer<'b, 'a> {
    data: &'b ApplyHostConfigRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ApplyHostConfigRequestTypeSer<'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"), &"ApplyHostConfigRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("host"), &self.data.host as &dyn miniserde::Serialize)),
                2 => return Some((std::borrow::Cow::Borrowed("configSpec"), &self.data.config_spec as &dyn miniserde::Serialize)),
                3 => {
                    let Some(ref val) = self.data.user_input else { continue; };
                    return Some((std::borrow::Cow::Borrowed("userInput"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct CheckAnswerFileStatusRequestType<'a> {
    host: &'a [crate::types::structs::ManagedObjectReference],
}

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

struct CheckAnswerFileStatusRequestTypeSer<'b, 'a> {
    data: &'b CheckAnswerFileStatusRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for CheckAnswerFileStatusRequestTypeSer<'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"), &"CheckAnswerFileStatusRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("host"), &self.data.host as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct CompositeHostProfileRequestType<'a> {
    source: &'a crate::types::structs::ManagedObjectReference,
    targets: Option<&'a [crate::types::structs::ManagedObjectReference]>,
    to_be_merged: Option<&'a crate::types::structs::HostApplyProfile>,
    to_be_replaced_with: Option<&'a crate::types::structs::HostApplyProfile>,
    to_be_deleted: Option<&'a crate::types::structs::HostApplyProfile>,
    enable_status_to_be_copied: Option<&'a crate::types::structs::HostApplyProfile>,
}

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

struct CompositeHostProfileRequestTypeSer<'b, 'a> {
    data: &'b CompositeHostProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for CompositeHostProfileRequestTypeSer<'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"), &"CompositeHostProfileRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("source"), &self.data.source as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.targets else { continue; };
                    return Some((std::borrow::Cow::Borrowed("targets"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.to_be_merged else { continue; };
                    return Some((std::borrow::Cow::Borrowed("toBeMerged"), val as &dyn miniserde::Serialize));
                }
                4 => {
                    let Some(ref val) = self.data.to_be_replaced_with else { continue; };
                    return Some((std::borrow::Cow::Borrowed("toBeReplacedWith"), val as &dyn miniserde::Serialize));
                }
                5 => {
                    let Some(ref val) = self.data.to_be_deleted else { continue; };
                    return Some((std::borrow::Cow::Borrowed("toBeDeleted"), val as &dyn miniserde::Serialize));
                }
                6 => {
                    let Some(ref val) = self.data.enable_status_to_be_copied else { continue; };
                    return Some((std::borrow::Cow::Borrowed("enableStatusToBeCopied"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct CreateDefaultProfileRequestType<'a> {
    profile_type: &'a str,
    profile_type_name: Option<&'a str>,
    profile: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct CreateDefaultProfileRequestTypeSer<'b, 'a> {
    data: &'b CreateDefaultProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for CreateDefaultProfileRequestTypeSer<'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"), &"CreateDefaultProfileRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("profileType"), &self.data.profile_type as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.profile_type_name else { continue; };
                    return Some((std::borrow::Cow::Borrowed("profileTypeName"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.profile else { continue; };
                    return Some((std::borrow::Cow::Borrowed("profile"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct CreateProfileRequestType<'a> {
    create_spec: &'a dyn crate::types::traits::ProfileCreateSpecTrait,
}

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

struct CreateProfileRequestTypeSer<'b, 'a> {
    data: &'b CreateProfileRequestType<'a>,
    seq: usize,
}

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

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

struct ExportAnswerFileRequestTypeSer<'b, 'a> {
    data: &'b ExportAnswerFileRequestType<'a>,
    seq: usize,
}

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

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

struct FindAssociatedProfileRequestTypeSer<'b, 'a> {
    data: &'b FindAssociatedProfileRequestType<'a>,
    seq: usize,
}

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

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

struct GenerateConfigTaskListRequestTypeSer<'b, 'a> {
    data: &'b GenerateConfigTaskListRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for GenerateConfigTaskListRequestTypeSer<'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"), &"GenerateConfigTaskListRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("configSpec"), &self.data.config_spec as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("host"), &self.data.host as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct GenerateHostConfigTaskSpecRequestType<'a> {
    hosts_info: Option<&'a [crate::types::structs::StructuredCustomizations]>,
}

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

struct GenerateHostConfigTaskSpecRequestTypeSer<'b, 'a> {
    data: &'b GenerateHostConfigTaskSpecRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for GenerateHostConfigTaskSpecRequestTypeSer<'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"), &"GenerateHostConfigTaskSpecRequestType")),
                1 => {
                    let Some(ref val) = self.data.hosts_info else { continue; };
                    return Some((std::borrow::Cow::Borrowed("hostsInfo"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct GenerateHostProfileTaskListRequestType<'a> {
    config_spec: &'a crate::types::structs::HostConfigSpec,
    host: &'a crate::types::structs::ManagedObjectReference,
}

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

struct GenerateHostProfileTaskListRequestTypeSer<'b, 'a> {
    data: &'b GenerateHostProfileTaskListRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for GenerateHostProfileTaskListRequestTypeSer<'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"), &"GenerateHostProfileTaskListRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("configSpec"), &self.data.config_spec as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("host"), &self.data.host as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryAnswerFileStatusRequestType<'a> {
    host: &'a [crate::types::structs::ManagedObjectReference],
}

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

struct QueryAnswerFileStatusRequestTypeSer<'b, 'a> {
    data: &'b QueryAnswerFileStatusRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryAnswerFileStatusRequestTypeSer<'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"), &"QueryAnswerFileStatusRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("host"), &self.data.host as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryPolicyMetadataRequestType<'a> {
    policy_name: Option<&'a [String]>,
    profile: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct QueryPolicyMetadataRequestTypeSer<'b, 'a> {
    data: &'b QueryPolicyMetadataRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryPolicyMetadataRequestTypeSer<'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"), &"QueryPolicyMetadataRequestType")),
                1 => {
                    let Some(ref val) = self.data.policy_name else { continue; };
                    return Some((std::borrow::Cow::Borrowed("policyName"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.profile else { continue; };
                    return Some((std::borrow::Cow::Borrowed("profile"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct QueryHostProfileMetadataRequestType<'a> {
    profile_name: Option<&'a [String]>,
    profile: Option<&'a crate::types::structs::ManagedObjectReference>,
}

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

struct QueryHostProfileMetadataRequestTypeSer<'b, 'a> {
    data: &'b QueryHostProfileMetadataRequestType<'a>,
    seq: usize,
}

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

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

struct QueryProfileStructureRequestTypeSer<'b, 'a> {
    data: &'b QueryProfileStructureRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryProfileStructureRequestTypeSer<'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"), &"QueryProfileStructureRequestType")),
                1 => {
                    let Some(ref val) = self.data.profile else { continue; };
                    return Some((std::borrow::Cow::Borrowed("profile"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct RetrieveAnswerFileRequestType<'a> {
    host: &'a crate::types::structs::ManagedObjectReference,
}

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

struct RetrieveAnswerFileRequestTypeSer<'b, 'a> {
    data: &'b RetrieveAnswerFileRequestType<'a>,
    seq: usize,
}

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

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

struct RetrieveAnswerFileForProfileRequestTypeSer<'b, 'a> {
    data: &'b RetrieveAnswerFileForProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RetrieveAnswerFileForProfileRequestTypeSer<'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"), &"RetrieveAnswerFileForProfileRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("host"), &self.data.host as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("applyProfile"), &self.data.apply_profile as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct RetrieveHostCustomizationsRequestType<'a> {
    hosts: Option<&'a [crate::types::structs::ManagedObjectReference]>,
}

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

struct RetrieveHostCustomizationsRequestTypeSer<'b, 'a> {
    data: &'b RetrieveHostCustomizationsRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RetrieveHostCustomizationsRequestTypeSer<'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"), &"RetrieveHostCustomizationsRequestType")),
                1 => {
                    let Some(ref val) = self.data.hosts else { continue; };
                    return Some((std::borrow::Cow::Borrowed("hosts"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct RetrieveHostCustomizationsForProfileRequestType<'a> {
    hosts: Option<&'a [crate::types::structs::ManagedObjectReference]>,
    apply_profile: &'a crate::types::structs::HostApplyProfile,
}

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

struct RetrieveHostCustomizationsForProfileRequestTypeSer<'b, 'a> {
    data: &'b RetrieveHostCustomizationsForProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RetrieveHostCustomizationsForProfileRequestTypeSer<'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"), &"RetrieveHostCustomizationsForProfileRequestType")),
                1 => {
                    let Some(ref val) = self.data.hosts else { continue; };
                    return Some((std::borrow::Cow::Borrowed("hosts"), val as &dyn miniserde::Serialize));
                }
                2 => return Some((std::borrow::Cow::Borrowed("applyProfile"), &self.data.apply_profile as &dyn miniserde::Serialize)),
                _ => return None,
            }
        }
    }
}
struct UpdateAnswerFileRequestType<'a> {
    host: &'a crate::types::structs::ManagedObjectReference,
    config_spec: &'a dyn crate::types::traits::AnswerFileCreateSpecTrait,
}

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

struct UpdateAnswerFileRequestTypeSer<'b, 'a> {
    data: &'b UpdateAnswerFileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for UpdateAnswerFileRequestTypeSer<'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"), &"UpdateAnswerFileRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("host"), &self.data.host as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("configSpec"), &self.data.config_spec as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct ValidateHostProfileCompositionRequestType<'a> {
    source: &'a crate::types::structs::ManagedObjectReference,
    targets: Option<&'a [crate::types::structs::ManagedObjectReference]>,
    to_be_merged: Option<&'a crate::types::structs::HostApplyProfile>,
    to_replace_with: Option<&'a crate::types::structs::HostApplyProfile>,
    to_be_deleted: Option<&'a crate::types::structs::HostApplyProfile>,
    enable_status_to_be_copied: Option<&'a crate::types::structs::HostApplyProfile>,
    error_only: Option<bool>,
}

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

struct ValidateHostProfileCompositionRequestTypeSer<'b, 'a> {
    data: &'b ValidateHostProfileCompositionRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ValidateHostProfileCompositionRequestTypeSer<'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"), &"ValidateHostProfileCompositionRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("source"), &self.data.source as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.targets else { continue; };
                    return Some((std::borrow::Cow::Borrowed("targets"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.to_be_merged else { continue; };
                    return Some((std::borrow::Cow::Borrowed("toBeMerged"), val as &dyn miniserde::Serialize));
                }
                4 => {
                    let Some(ref val) = self.data.to_replace_with else { continue; };
                    return Some((std::borrow::Cow::Borrowed("toReplaceWith"), val as &dyn miniserde::Serialize));
                }
                5 => {
                    let Some(ref val) = self.data.to_be_deleted else { continue; };
                    return Some((std::borrow::Cow::Borrowed("toBeDeleted"), val as &dyn miniserde::Serialize));
                }
                6 => {
                    let Some(ref val) = self.data.enable_status_to_be_copied else { continue; };
                    return Some((std::borrow::Cow::Borrowed("enableStatusToBeCopied"), val as &dyn miniserde::Serialize));
                }
                7 => {
                    let Some(ref val) = self.data.error_only else { continue; };
                    return Some((std::borrow::Cow::Borrowed("errorOnly"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}