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
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// The HostSystem managed object type provides access to a virtualization
/// host platform.
/// 
/// Invoking destroy on a HostSystem of standalone type throws a NotSupported fault.
/// A standalone HostSystem can be destroyed only by invoking destroy on its parent
/// ComputeResource.
/// Invoking destroy on a failover host throws a
/// *DisallowedOperationOnFailoverHost* fault. See
/// *ClusterFailoverHostAdmissionControlPolicy*.
#[derive(Clone)]
pub struct HostSystem {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl HostSystem {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// Creates and returns a credential used to establish a remote
    /// connection to a Web Based Management (CIM) interface.
    /// 
    /// Valid only
    /// when ESXi wbem authentication mode is set to password.
    /// The ticket provides the port for the service and sslThumbprint/sslCertificate
    /// should be used by client to validate ssl connection. This ticket is valid for 2
    /// minutes then will expire and is non-renewable.
    /// 
    /// ***Required privileges:*** Host.Cim.CimInteraction
    pub async fn acquire_cim_services_ticket(&self) -> Result<crate::types::structs::HostServiceTicket> {
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "AcquireCimServicesTicket", None).await?;
        let result: crate::types::structs::HostServiceTicket = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Sets/changes the key to be used for coredump encryption
    /// and puts the host in *safe* state.
    /// 
    /// This function will make the host crypto safe and unlock all encrypted
    /// VMs on the host. When the encryption on the host is enabled for the
    /// first time after adding it to vCenter Server, this method will start
    /// sending asynchronously all the encryption keys for VMs on the host and
    /// cluster to unlock encrypted VMs.
    /// This API behaves differently on the ESXi host vs. the vCenter server.
    /// Before vSphere 7.0, it is not supported on host, and invoking directly
    /// on a host will throw NotSupported fault. Since vSphere 7.0, calling the
    /// API on host will make the host crypto safe, but the parameter should not
    /// be blank and should only be a key id from a trusted key provider.
    /// 
    /// ***Required privileges:*** Cryptographer.RegisterHost
    ///
    /// ## Parameters:
    ///
    /// ### key_id
    /// The key to be used for coredump encryption. If unset, uses
    /// existing host or cluster key or new key is generated from
    /// the default KMIP server.
    pub async fn configure_crypto_key(&self, key_id: Option<&crate::types::structs::CryptoKeyId>) -> Result<()> {
        let input = ConfigureCryptoKeyRequestType {key_id, };
        self.client.invoke_void("", "HostSystem", &self.mo_id, "ConfigureCryptoKey", Some(&input)).await
    }
    /// Destroys this object, deleting its contents and removing it from its parent
    /// folder (if any).
    /// 
    /// NOTE: The appropriate privilege must be held on the parent of the destroyed
    /// entity as well as the entity itself.
    /// This method can throw one of several exceptions. The exact set of exceptions
    /// depends on the kind of entity that is being removed. See comments for
    /// each entity for more information on destroy behavior.
    /// 
    /// ***Required privileges:*** Host.Inventory.RemoveHostFromCluster
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// Failure
    pub async fn destroy_task(&self) -> Result<crate::types::structs::ManagedObjectReference> {
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "Destroy_Task", None).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Disconnects from a host and instructs the server to stop sending heartbeats.
    /// 
    /// ***Required privileges:*** Host.Config.Connection
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    pub async fn disconnect_host_task(&self) -> Result<crate::types::structs::ManagedObjectReference> {
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "DisconnectHost_Task", None).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Sets/changes the key to be used for coredump encryption
    /// and puts the host in *safe* state
    /// Note: *HostSystem.PrepareCrypto* must be called first
    /// 
    /// ***Required privileges:*** Cryptographer.RegisterHost
    ///
    /// ## Parameters:
    ///
    /// ### key_plain
    /// The key to be used for coredump encryption
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: if the host is in
    /// *incapable* state
    pub async fn enable_crypto(&self, key_plain: &crate::types::structs::CryptoKeyPlain) -> Result<()> {
        let input = EnableCryptoRequestType {key_plain, };
        self.client.invoke_void("", "HostSystem", &self.mo_id, "EnableCrypto", Some(&input)).await
    }
    /// Deprecated as of vSphere API 6.0, use
    /// *HostAccessManager.ChangeLockdownMode*.
    /// 
    /// Modifies the permissions on the host, so that it will only be accessible
    /// through local console or an authorized centralized management application.
    /// 
    /// Any user defined permissions found on the host are lost.
    /// 
    /// Access via a VI client connected to the host is blocked.
    /// Access though other services running on the host is also blocked.
    /// 
    /// If the operation is successful, *HostConfigInfo.adminDisabled*
    /// will be set to true. This API is not supported on the host, If invoked
    /// directly on a host, a NotSupported fault will be thrown.
    /// 
    /// See also *AuthorizationManager*for more information on permissions..
    /// 
    /// ***Required privileges:*** Host.Config.Settings
    ///
    /// ## Errors:
    ///
    /// ***AdminDisabled***: If the host's Administrator permission has been
    /// disabled.
    /// 
    /// ***DisableAdminNotSupported***: If invoked directly on the host or the
    /// host doesn't support this operation.
    pub async fn enter_lockdown_mode(&self) -> Result<()> {
        self.client.invoke_void("", "HostSystem", &self.mo_id, "EnterLockdownMode", None).await
    }
    /// Puts the host in maintenance mode.
    /// 
    /// While this task is running and when the host is
    /// in maintenance mode, no virtual machines can be powered on and no provisioning
    /// operations can be performed on the host. Once the call completes, it is safe to
    /// turn off a host without disrupting any virtual machines.
    /// 
    /// The task completes once there are no powered-on virtual machines on the host and
    /// no provisioning operations in progress on the host. The operation does not
    /// directly initiate any operations to evacuate or power-down powered-on virtual machines.
    /// However, if the host is part of a cluster with VMware DRS enabled, DRS provides
    /// migration recommendations to evacuate the powered-on virtual machines. If DRS is in
    /// fully-automatic mode, these are automatically scheduled.
    /// 
    /// If the host is part of a cluster and the task is issued through VirtualCenter with
    /// evacuatePoweredOffVms set to true, the task will not succeed unless all the
    /// powered-off virtual machines are reregistered to other hosts. If VMware DRS is
    /// enabled, vCenter Server will automatically evacuate powered-off virtual machines.
    /// 
    /// If this API is called directly on the ESXi host, then the user is responsible
    /// for powering off, suspending or evacuating all powered-on virtual machines.
    /// The task is cancellable.
    /// 
    /// ***Required privileges:*** Host.Config.Maintenance
    ///
    /// ## Parameters:
    ///
    /// ### timeout
    /// The task completes when the host successfully enters maintenance
    /// mode or the timeout expires, and in the latter case the task
    /// contains a Timeout fault. If the timeout is less than or equal to
    /// zero, there is no timeout. The timeout is specified in seconds.
    ///
    /// ### evacuate_powered_off_vms
    /// This is a parameter only supported by VirtualCenter.
    /// If set to true, for a DRS disabled cluster, the task will not
    /// succeed unless all powered-off virtual machines have been manually
    /// reregistered; for a DRS enabled cluster, VirtualCenter will
    /// automatically reregister powered-off virtual machines and a
    /// powered-off virtual machine may remain at the host only for two
    /// reasons: (a) no compatible host found for reregistration, (b) DRS
    /// is disabled for the virtual machine. If set to false, powered-off
    /// virtual machines do not need to be moved.
    ///
    /// ### maintenance_spec
    /// Any additional actions to be taken by the host upon
    /// entering maintenance mode. If omitted, default actions will
    /// be taken as documented in the *HostMaintenanceSpec*.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: if the host is already in maintenance mode.
    /// 
    /// ***Timedout***: if the operation timed out.
    /// 
    /// ***RequestCanceled***: if the operation is canceled.
    pub async fn enter_maintenance_mode_task(&self, timeout: i32, evacuate_powered_off_vms: Option<bool>, maintenance_spec: Option<&crate::types::structs::HostMaintenanceSpec>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = EnterMaintenanceModeRequestType {timeout, evacuate_powered_off_vms, maintenance_spec, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "EnterMaintenanceMode_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Puts the host in standby mode, a mode in which the host is in a
    /// standby state from which it can be powered up remotely.
    /// 
    /// While
    /// this task is running, no virtual machines can be powered on and
    /// no provisioning operations can be performed on the host.
    /// 
    /// The task completes only if there are no powered-on virtual
    /// machines on the host, no provisioning operations in progress on
    /// the host, and the host stopped responding. The operation does
    /// not directly initiate any operations to evacuate or power-down
    /// powered-on virtual machines. However, if a dynamic recommendation
    /// generation module is running, if possible, it will provide, and
    /// depending on the automation level, it will execute migrations
    /// of powered-on virtual machine. Furthermore, VMware power
    /// management module may evacute and put a host in standby mode to
    /// save power.
    /// If the host is part of a cluster and the task is issued through VirtualCenter with
    /// evacuatePoweredOffVms set to true, the task will not succeed unless all the
    /// powered-off virtual machines are reregistered to other hosts. If VMware DRS is
    /// enabled, vCenter Server will automatically evacuate powered-off virtual machines.
    /// 
    /// The task is cancellable.
    /// 
    /// This command is not supported on all hosts. Check the host capability
    /// *HostCapability.standbySupported*.
    /// 
    /// ***Required privileges:*** Host.Config.Maintenance
    ///
    /// ## Parameters:
    ///
    /// ### timeout_sec
    /// The task completes when the host successfully
    /// enters standby mode and stops sending heartbeat signals.
    /// If heartbeats are still coming after timeoutSecs seconds,
    /// the host is declared timedout, and the task is assumed
    /// failed.
    ///
    /// ### evacuate_powered_off_vms
    /// This is a parameter used only by VirtualCenter. If
    /// set to true, for a DRS disabled cluster, the task will not
    /// succeed unless all powered-off virtual machines have been manually
    /// reregistered; for a DRS enabled cluster, VirtualCenter will
    /// automatically reregister powered-off virtual machines and a
    /// powered-off virtual machine may remain at the host only for two
    /// reasons: (a) no compatible host found for reregistration, (b) DRS
    /// is disabled for the virtual machine.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***HostPowerOpFailed***: if the standby operation fails.
    /// 
    /// ***InvalidState***: if the host is already in standby mode, or disconnected.
    /// 
    /// ***NotSupported***: if the host does not support standby mode.
    /// 
    /// ***Timedout***: if the host did not enter standby mode in the given time
    /// 
    /// ***RequestCanceled***: if the operation is canceled.
    pub async fn power_down_host_to_stand_by_task(&self, timeout_sec: i32, evacuate_powered_off_vms: Option<bool>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = PowerDownHostToStandByRequestType {timeout_sec, evacuate_powered_off_vms, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "PowerDownHostToStandBy_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of vSphere API 6.0, use
    /// *HostAccessManager.ChangeLockdownMode*.
    /// 
    /// Restores Administrator permission for the local administrative account
    /// for the host that was removed by prior call to *HostSystem.EnterLockdownMode*.
    /// 
    /// If the operation is successful,
    /// *HostConfigInfo.adminDisabled* will be set to false. This API
    /// is not supported on the host. If invoked directly on a host, a
    /// NotSupported fault will be thrown.
    /// 
    /// See also *AuthorizationManager*for more information on permissions..
    /// 
    /// ***Required privileges:*** Host.Config.Settings
    ///
    /// ## Errors:
    ///
    /// ***DisableAdminNotSupported***: If invoked directly on the host or the
    /// host doesn't support this operation.
    /// 
    /// ***AdminNotDisabled***: If the host's Administrator permission
    /// is not disabled.
    pub async fn exit_lockdown_mode(&self) -> Result<()> {
        self.client.invoke_void("", "HostSystem", &self.mo_id, "ExitLockdownMode", None).await
    }
    /// Takes the host out of maintenance mode.
    /// 
    /// This blocks if any concurrent
    /// running maintenance-only host configurations operations are being performed.
    /// For example, if VMFS volumes are being upgraded.
    /// 
    /// The task is cancellable.
    /// 
    /// ***Required privileges:*** Host.Config.Maintenance
    ///
    /// ## Parameters:
    ///
    /// ### timeout
    /// Number of seconds to wait for the exit maintenance mode to
    /// succeed. If the timeout is less than or equal to zero, there
    /// is no timeout.
    ///
    /// ## 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.
    pub async fn exit_maintenance_mode_task(&self, timeout: i32) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ExitMaintenanceModeRequestType {timeout, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "ExitMaintenanceMode_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Takes the host out of standby mode.
    /// 
    /// If the command is
    /// successful, the host wakes up and starts sending
    /// heartbeats. This method may be called automatically by a
    /// dynamic recommendation generation module to add capacity to a
    /// cluster, if the host is not in maintenance mode.
    /// 
    /// Note that, depending on the implementation of the wakeup
    /// method, the client may never receive an indicator of success in
    /// the returned task. In some cases, it is not even possible to
    /// ensure that the wakeup request has made it to the host.
    /// 
    /// The task is cancellable.
    /// 
    /// ***Required privileges:*** Host.Config.Maintenance
    ///
    /// ## Parameters:
    ///
    /// ### timeout_sec
    /// The task completes when the host successfully
    /// exits standby state and sends a heartbeat signal. If nothing is
    /// received from the host for timeoutSec seconds, the host is
    /// declared timedout, and the task is assumed failed.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***HostPowerOpFailed***: if the standby operation fails.
    /// 
    /// ***InvalidState***: if the host is in a state from which it
    /// cannot be woken up (e.g., disconnected, poweredOff)
    /// 
    /// ***NotSupported***: if the host does not support standby mode.
    /// 
    /// ***Timedout***: if the host did not exit standby mode in the given time
    /// 
    /// ***RequestCanceled***: if the operation is canceled.
    pub async fn power_up_host_from_stand_by_task(&self, timeout_sec: i32) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = PowerUpHostFromStandByRequestType {timeout_sec, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "PowerUpHostFromStandBy_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Prepare the host for receiving sensitive information
    /// and puts the host in *prepared* mode
    /// Note: Must be invoked before *HostSystem.EnableCrypto*
    /// 
    /// ***Required privileges:*** Cryptographer.RegisterHost
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: if the host is not in
    /// *incapable* state
    pub async fn prepare_crypto(&self) -> Result<()> {
        self.client.invoke_void("", "HostSystem", &self.mo_id, "PrepareCrypto", None).await
    }
    /// Connection-oriented information about a host.
    /// 
    /// ***Required privileges:*** System.Read
    pub async fn query_host_connection_info(&self) -> Result<crate::types::structs::HostConnectInfo> {
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "QueryHostConnectionInfo", None).await?;
        let result: crate::types::structs::HostConnectInfo = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of VI API 2.5, use *HostSystem.QueryMemoryOverheadEx*.
    /// 
    /// Determines the amount of memory overhead necessary to power on a virtual
    /// machine with the specified characteristics.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Parameters:
    ///
    /// ### memory_size
    /// The amount of virtual system RAM, in bytes. For an existing
    /// virtual machine, this value can be found (in megabytes) as the memoryMB
    /// property of the *VirtualHardware*.
    ///
    /// ### video_ram_size
    /// The amount of virtual video RAM, in bytes. For an existing
    /// virtual machine on a host that supports advertising this property, this
    /// value can be found (in kilobytes) as the videoRamSizeInKB property of the
    /// *VirtualMachineVideoCard*. If this parameter is left unset, the
    /// default video RAM size for virtual machines on this host is assumed.
    ///
    /// ### num_vcpus
    /// The number of virtual CPUs. For an existing virtual machine, this
    /// value can be found as the numCPU property of the
    /// *VirtualHardware*.
    ///
    /// ## Returns:
    ///
    /// The amount of overhead memory required to power on such a virtual machine,
    /// in bytes.
    pub async fn query_memory_overhead(&self, memory_size: i64, video_ram_size: Option<i32>, num_vcpus: i32) -> Result<i64> {
        let input = QueryMemoryOverheadRequestType {memory_size, video_ram_size, num_vcpus, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "QueryMemoryOverhead", Some(&input)).await?;
        let result: i64 = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of VI API 6.0, use
    /// *VirtualMachineConfigInfo.initialOverhead*.
    /// 
    /// Determines the amount of memory overhead necessary to power on a virtual
    /// machine with the specified characteristics.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Parameters:
    ///
    /// ### vm_config_info
    /// The configuration of the virtual machine.
    ///
    /// ## Returns:
    ///
    /// The amount of overhead memory required to power on such a virtual machine,
    /// in bytes.
    pub async fn query_memory_overhead_ex(&self, vm_config_info: &crate::types::structs::VirtualMachineConfigInfo) -> Result<i64> {
        let input = QueryMemoryOverheadExRequestType {vm_config_info, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "QueryMemoryOverheadEx", Some(&input)).await?;
        let result: i64 = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Query the path to VMware Tools repository configured on the host.
    /// 
    /// The host should be powered on.
    /// 
    /// ***Required privileges:*** System.Read
    ///
    /// ## Returns:
    ///
    /// The absolute path currently set for the VMware Tools
    /// repository on the host.
    ///
    /// ## Errors:
    ///
    /// ***HostConfigFault***: if the configuration could not be read.
    pub async fn query_product_locker_location(&self) -> Result<String> {
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "QueryProductLockerLocation", None).await?;
        let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Basic information about TPM attestation state of the host.
    /// 
    /// ***Required privileges:*** System.Read
    pub async fn query_tpm_attestation_report(&self) -> Result<Option<crate::types::structs::HostTpmAttestationReport>> {
        let bytes_opt = self.client.invoke_optional("", "HostSystem", &self.mo_id, "QueryTpmAttestationReport", None).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Reboots a host.
    /// 
    /// If the command is successful, then the host has been rebooted. If
    /// connected directly to the host, the client never receives an indicator of success
    /// in the returned task but simply loses connection to the host, upon success.
    /// 
    /// This command is not supported on all hosts. Check the host capability
    /// *vim.host.Capability.rebootSupported*.
    /// If QuickBoot is enabled on the host, additional setup steps are performed.
    /// 
    /// ***Required privileges:*** Host.Config.Maintenance
    ///
    /// ## Parameters:
    ///
    /// ### force
    /// Flag to specify whether or not the host should be rebooted
    /// regardless of whether it is in maintenance mode. If true, the host
    /// is rebooted, even if there are virtual machines running or other
    /// operations in progress.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: if "force" is false and the host is not in maintenance mode.
    /// 
    /// ***NotSupported***: if the host does not support the reboot operation.
    pub async fn reboot_host_task(&self, force: bool) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = RebootHostRequestType {force, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "RebootHost_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Reconfigures the host for vSphere HA.
    /// 
    /// If the host is part of a HA cluster, this operation reconfigures the host for HA.
    /// For example, this operation may be used if a host is added to a HA enabled cluster
    /// and the automatic HA configuration system task fails. Automatic HA configuration
    /// may fail for a variety of reasons. For example, the host is configured
    /// incorrectly.
    /// 
    /// ***Required privileges:*** Host.Config.Connection
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***NotSupported***: if run directly on an ESX Server host.
    /// 
    /// ***DasConfigFault***: if there is a problem reconfiguring the host for HA.
    pub async fn reconfigure_host_for_das_task(&self) -> Result<crate::types::structs::ManagedObjectReference> {
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "ReconfigureHostForDAS_Task", None).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Reconnects to a host.
    /// 
    /// This process reinstalls agents and reconfigures the host, if
    /// it has gotten out of date with VirtualCenter. The reconnection process goes
    /// through many of the same steps as addHost: ensuring the correct set of licenses
    /// for the number of CPUs on the host, ensuring the correct set of agents is
    /// installed, and ensuring that networks and datastores are discovered and registered
    /// with VirtualCenter.
    /// 
    /// The client can change the IP address and port of the host when doing a reconnect
    /// operation. This can be useful if the client wants to preserve existing metadata,
    /// even though the host is changing its IP address. For example, clients could
    /// preserve existing statistics, alarms, and privileges.
    /// 
    /// This method can also be used to change the SSL thumbprint of a connected host
    /// without disconnecting it.
    /// 
    /// Any changes made to the resource hierarchy on the host when the host
    /// was disconnected are overriden by VirtualCenter settings on
    /// reconnect.
    /// 
    /// This method is only supported through VirtualCenter.
    /// 
    /// ***Required privileges:*** Host.Config.Connection
    ///
    /// ## Parameters:
    ///
    /// ### cnx_spec
    /// Includes the parameters to use, including user name and password,
    /// when reconnecting to the host. If this parameter is not specified,
    /// the default connection parameters is used.
    ///
    /// ### reconnect_spec
    /// Includes connection parameters specific to
    /// reconnect. This will mainly be used to indicate how to
    /// handle divergence between the host settings and vCenter Server
    /// settings when the host was disconnected.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***NotSupported***: if no host can be added to this group. This is the case if
    /// the ComputeResource is a standalone type.
    /// 
    /// ***InvalidLogin***: if the method fails to authenticate with the host.
    /// 
    /// ***AlreadyBeingManaged***: if host is already being managed by another
    /// VirtualCenter server
    /// 
    /// ***NotEnoughLicenses***: if there are not enough licenses to add this host.
    /// 
    /// ***NoHost***: if the method is unable to contact the server.
    /// 
    /// ***NotSupportedHost***: if the host is running a software version that is not
    /// supported.
    /// 
    /// ***InvalidState***: if the host is not disconnected.
    /// 
    /// ***InvalidName***: if the host name is invalid.
    /// 
    /// ***HostConnectFault***: if an error occurred when attempting to reconnect
    /// to a host. Typically, a more specific subclass, such as
    /// AlreadyBeingManaged, is thrown.
    /// 
    /// ***SSLVerifyFault***: if the host certificate could not be authenticated.
    pub async fn reconnect_host_task(&self, cnx_spec: Option<&crate::types::structs::HostConnectSpec>, reconnect_spec: Option<&crate::types::structs::HostSystemReconnectSpec>) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ReconnectHostRequestType {cnx_spec, reconnect_spec, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "ReconnectHost_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Reload the entity state.
    /// 
    /// Clients only need to call this method
    /// if they changed some external state that affects the service
    /// without using the Web service interface to perform the change.
    /// For example, hand-editing a virtual machine configuration file
    /// affects the configuration of the associated virtual machine but
    /// the service managing the virtual machine might not monitor the
    /// file for changes. In this case, after such an edit, a client
    /// would call "reload" on the associated virtual machine to ensure
    /// the service and its clients have current data for the
    /// virtual machine.
    /// 
    /// ***Required privileges:*** System.Read
    pub async fn reload(&self) -> Result<()> {
        self.client.invoke_void("", "HostSystem", &self.mo_id, "Reload", None).await
    }
    /// Renames this managed entity.
    /// 
    /// Any % (percent) character used in this name parameter
    /// must be escaped, unless it is used to start an escape
    /// sequence. Clients may also escape any other characters in
    /// this name parameter.
    /// 
    /// See also *ManagedEntity.name*.
    /// 
    /// ***Required privileges:*** Host.Config.Settings
    ///
    /// ## Parameters:
    ///
    /// ### new_name
    /// -
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***DuplicateName***: If another object in the same folder has the target name.
    /// 
    /// ***InvalidName***: If the new name is not a valid entity name.
    pub async fn rename_task(&self, new_name: &str) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = RenameRequestType {new_name, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "Rename_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Return the amount of free EPC memory on the host in bytes.
    /// 
    /// ***Required privileges:*** System.Read
    pub async fn retrieve_free_epc_memory(&self) -> Result<i64> {
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "RetrieveFreeEpcMemory", None).await?;
        let result: i64 = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Return the hardware uptime of the host in seconds.
    /// 
    /// The harware uptime of a host is not affected by NTP and changes to its
    /// wall clock time and can be used by clients to provide a common time
    /// reference for all hosts.
    /// 
    /// ***Required privileges:*** System.Read
    pub async fn retrieve_hardware_uptime(&self) -> Result<i64> {
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "RetrieveHardwareUptime", None).await?;
        let result: i64 = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Assigns a value to a custom field.
    /// 
    /// The setCustomValue method requires
    /// whichever updatePrivilege is defined as one of the
    /// *CustomFieldDef.fieldInstancePrivileges*
    /// for the CustomFieldDef whose value is being changed.
    ///
    /// ## Parameters:
    ///
    /// ### key
    /// The name of the field whose value is to be updated.
    ///
    /// ### value
    /// Value to be assigned to the custom field.
    pub async fn set_custom_value(&self, key: &str, value: &str) -> Result<()> {
        let input = SetCustomValueRequestType {key, value, };
        self.client.invoke_void("", "HostSystem", &self.mo_id, "setCustomValue", Some(&input)).await
    }
    /// Shuts down a host.
    /// 
    /// If the command is successful, then the host has been shut down.
    /// Thus, the client never receives an indicator of success in the returned task if
    /// connected directly to the host.
    /// 
    /// This command is not supported on all hosts. Check the host capability
    /// *HostCapability.shutdownSupported*.
    /// 
    /// ***Required privileges:*** Host.Config.Maintenance
    ///
    /// ## Parameters:
    ///
    /// ### force
    /// Flag to specify whether or not the host should be shut down
    /// regardless of whether it is in maintenance mode.
    /// If true, the host is shut down, even if there are
    /// virtual machines running or other operations in progress.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to monitor the
    /// operation.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidState***: if "force" is false and the host is not in
    /// maintenance mode.
    /// 
    /// ***NotSupported***: if the host does not support shutdown.
    pub async fn shutdown_host_task(&self, force: bool) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = ShutdownHostRequestType {force, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "ShutdownHost_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Update flags that are part of the *HostFlagInfo* object.
    /// 
    /// ***Required privileges:*** Host.Config.Settings
    ///
    /// ## Parameters:
    ///
    /// ### flag_info
    /// -
    pub async fn update_flags(&self, flag_info: &crate::types::structs::HostFlagInfo) -> Result<()> {
        let input = UpdateFlagsRequestType {flag_info, };
        self.client.invoke_void("", "HostSystem", &self.mo_id, "UpdateFlags", Some(&input)).await
    }
    /// Update fields that are part of the *HostIpmiInfo* object.
    /// 
    /// ***Required privileges:*** Host.Config.Settings
    ///
    /// ## Parameters:
    ///
    /// ### ipmi_info
    /// -
    ///
    /// ## Errors:
    ///
    /// ***InvalidIpmiLoginInfo***: if the supplied user ID and/or password is invalid.
    /// 
    /// ***InvalidIpmiMacAddress***: if the supplied MAC address is invalid.
    pub async fn update_ipmi(&self, ipmi_info: &crate::types::structs::HostIpmiInfo) -> Result<()> {
        let input = UpdateIpmiRequestType {ipmi_info, };
        self.client.invoke_void("", "HostSystem", &self.mo_id, "UpdateIpmi", Some(&input)).await
    }
    /// Change and reconfigure the VMware Tools repository on the host.
    /// 
    /// If the new path is the same as the path already configured on
    /// the host, no changes will be made to the host.
    /// The host should be powered on.
    /// 
    /// This task is not cancellable and cannot be reverted once started.
    /// 
    /// ***Required privileges:*** Host.Config.ProductLocker
    ///
    /// ## Parameters:
    ///
    /// ### path
    /// The absolute path for the VMware Tools repository
    /// on the host. It should have "/vmfs/volumes/" prefix and
    /// it should be a valid existing path, or it could be
    /// empty to restore to default value.
    ///
    /// ## Returns:
    ///
    /// This method returns a *Task* object with which to
    /// monitor the operation. The *info.result*
    /// property in the *Task* contains the stable vmfs path
    /// of the VMware Tools repository upon success. A stable vmfs
    /// path is of the form:
    /// /vmfs/volumes/\[datastore-uuid\]/\[path/inside/datastore\]
    /// or
    /// empty to indicate restoring to default value.
    /// 
    /// Refers instance of *Task*.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if the path does not have "/vmfs/volumes/"
    /// prefix and is not empty.
    /// 
    /// ***FileNotFound***: if the path does not exist.
    /// 
    /// ***TaskInProgress***: if there is another task configuring the
    /// VMware Tools repository on the host.
    /// 
    /// ***HostConfigFault***: if the configuration could not be written.
    pub async fn update_product_locker_location_task(&self, path: &str) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = UpdateProductLockerLocationRequestType {path, };
        let bytes = self.client.invoke("", "HostSystem", &self.mo_id, "UpdateProductLockerLocation_Task", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated as of Vsphere API 6.0. Please, contact VMware Support to get
    /// instructions on how to configure system ESX resource pools.
    /// 
    /// Update the configuration of the system resource hierarchy.
    /// 
    /// ***Required privileges:*** Host.Config.Resources
    ///
    /// ## Parameters:
    ///
    /// ### resource_info
    /// -
    pub async fn update_system_resources(&self, resource_info: &crate::types::structs::HostSystemResourceInfo) -> Result<()> {
        let input = UpdateSystemResourcesRequestType {resource_info, };
        self.client.invoke_void("", "HostSystem", &self.mo_id, "UpdateSystemResources", Some(&input)).await
    }
    /// Update the System Swap Configuration.
    /// 
    /// See also *HostSystemSwapConfiguration*.
    /// 
    /// ***Required privileges:*** Host.Config.Settings
    ///
    /// ## Parameters:
    ///
    /// ### sys_swap_config
    /// Contains a list of system swap options that
    /// configure the system swap functionality.
    pub async fn update_system_swap_configuration(&self, sys_swap_config: &crate::types::structs::HostSystemSwapConfiguration) -> Result<()> {
        let input = UpdateSystemSwapConfigurationRequestType {sys_swap_config, };
        self.client.invoke_void("", "HostSystem", &self.mo_id, "UpdateSystemSwapConfiguration", Some(&input)).await
    }
    /// Whether alarm actions are enabled for this entity.
    /// 
    /// True if enabled; false otherwise.
    /// 
    /// ***Required privileges:*** System.Read
    pub async fn alarm_actions_enabled(&self) -> Result<Option<bool>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "alarmActionsEnabled").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Host answer file validation result.
    pub async fn answer_file_validation_result(&self) -> Result<Option<crate::types::structs::AnswerFileStatusResult>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "answerFileValidationResult").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Host answer file validation state.
    pub async fn answer_file_validation_state(&self) -> Result<Option<crate::types::structs::AnswerFileStatusResult>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "answerFileValidationState").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// List of custom field definitions that are valid for the object's type.
    /// 
    /// The fields are sorted by *CustomFieldDef.name*.
    /// 
    /// ***Required privileges:*** System.View
    pub async fn available_field(&self) -> Result<Option<Vec<crate::types::structs::CustomFieldDef>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "availableField").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Host capabilities.
    /// 
    /// This might not be available for a
    /// disconnected host.
    pub async fn capability(&self) -> Result<Option<crate::types::structs::HostCapability>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "capability").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// The host profile compliance check result.
    pub async fn compliance_check_result(&self) -> Result<Option<crate::types::structs::ComplianceResult>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "complianceCheckResult").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// The host profile compliance check state.
    pub async fn compliance_check_state(&self) -> Result<Option<crate::types::structs::HostSystemComplianceCheckState>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "complianceCheckState").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Host configuration information.
    /// 
    /// This might not be available for a disconnected
    /// host.
    pub async fn config(&self) -> Result<Option<crate::types::structs::HostConfigInfo>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "config").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Current configuration issues that have been detected for this entity.
    /// 
    /// Typically,
    /// these issues have already been logged as events. The entity stores these
    /// events as long as they are still current. The
    /// *configStatus* property provides an overall status
    /// based on these events.
    pub async fn config_issue(&self) -> Result<Option<Vec<crate::types::structs::Event>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "configIssue").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Host configuration systems.
    /// 
    /// In releases after vSphere API 5.0, vSphere Servers might not
    /// generate property collector update notifications for this property.
    /// To obtain the latest value of the property, you can use
    /// PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx.
    /// If you use the PropertyCollector.WaitForUpdatesEx method, specify
    /// an empty string for the version parameter. Any other version value will not
    /// produce any property values as no updates are generated.
    pub async fn config_manager(&self) -> Result<crate::types::structs::HostConfigManager> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "configManager").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property configManager was empty".to_string()))?;
        let result: crate::types::structs::HostConfigManager = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// The configStatus indicates whether or not the system has detected a configuration
    /// issue involving this entity.
    /// 
    /// For example, it might have detected a
    /// duplicate IP address or MAC address, or a host in a cluster
    /// might be out of compliance. The meanings of the configStatus values are:
    /// - red: A problem has been detected involving the entity.
    /// - yellow: A problem is about to occur or a transient condition
    ///   has occurred (For example, reconfigure fail-over policy).
    /// - green: No configuration issues have been detected.
    /// - gray: The configuration status of the entity is not being monitored.
    ///   
    /// A green status indicates only that a problem has not been detected;
    /// it is not a guarantee that the entity is problem-free.
    /// 
    /// The *configIssue* property contains a list of the
    /// problems that have been detected.
    /// In releases after vSphere API 5.0, vSphere Servers might not
    /// generate property collector update notifications for this property.
    /// To obtain the latest value of the property, you can use
    /// PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx.
    /// If you use the PropertyCollector.WaitForUpdatesEx method, specify
    /// an empty string for the version parameter. Any other version value will not
    /// produce any property values as no updates are generated.
    pub async fn config_status(&self) -> Result<crate::types::enums::ManagedEntityStatusEnum> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "configStatus").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property configStatus was empty".to_string()))?;
        let result: crate::types::enums::ManagedEntityStatusEnum = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// Custom field values.
    /// 
    /// ***Required privileges:*** System.View
    pub async fn custom_value(&self) -> Result<Option<Vec<Box<dyn crate::types::traits::CustomFieldValueTrait>>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "customValue").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// A collection of references to the subset of datastore objects in the datacenter
    /// that are available in this HostSystem.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Returns:
    ///
    /// Refers instances of *Datastore*.
    pub async fn datastore(&self) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "datastore").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// DatastoreBrowser to browse datastores for this host.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Returns:
    ///
    /// Refers instance of *HostDatastoreBrowser*.
    pub async fn datastore_browser(&self) -> Result<crate::types::structs::ManagedObjectReference> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "datastoreBrowser").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property datastoreBrowser was empty".to_string()))?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// A set of alarm states for alarms that apply to this managed entity.
    /// 
    /// The set includes alarms defined on this entity
    /// and alarms inherited from the parent entity,
    /// or from any ancestors in the inventory hierarchy.
    /// 
    /// Alarms are inherited if they can be triggered by this entity or its descendants.
    /// This set does not include alarms that are defined on descendants of this entity.
    /// 
    /// ***Required privileges:*** System.View
    pub async fn declared_alarm_state(&self) -> Result<Option<Vec<crate::types::structs::AlarmState>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "declaredAlarmState").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// List of operations that are disabled, given the current runtime
    /// state of the entity.
    /// 
    /// For example, a power-on operation always fails if a
    /// virtual machine is already powered on. This list can be used by clients to
    /// enable or disable operations in a graphical user interface.
    /// 
    /// Note: This list is determined by the current runtime state of an entity,
    /// not by its permissions.
    /// 
    /// This list may include the following operations for a HostSystem:
    /// - *HostSystem.EnterMaintenanceMode_Task*
    /// - *HostSystem.ExitMaintenanceMode_Task*
    /// - *HostSystem.RebootHost_Task*
    /// - *HostSystem.ShutdownHost_Task*
    /// - *HostSystem.ReconnectHost_Task*
    /// - *HostSystem.DisconnectHost_Task*
    ///   
    /// This list may include the following operations for a VirtualMachine:
    /// - *VirtualMachine.AnswerVM*
    /// - *ManagedEntity.Rename_Task*
    /// - *VirtualMachine.CloneVM_Task*
    /// - *VirtualMachine.PowerOffVM_Task*
    /// - *VirtualMachine.PowerOnVM_Task*
    /// - *VirtualMachine.SuspendVM_Task*
    /// - *VirtualMachine.ResetVM_Task*
    /// - *VirtualMachine.ReconfigVM_Task*
    /// - *VirtualMachine.RelocateVM_Task*
    /// - *VirtualMachine.MigrateVM_Task*
    /// - *VirtualMachine.CustomizeVM_Task*
    /// - *VirtualMachine.ShutdownGuest*
    /// - *VirtualMachine.StandbyGuest*
    /// - *VirtualMachine.RebootGuest*
    /// - *VirtualMachine.CreateSnapshot_Task*
    /// - *VirtualMachine.RemoveAllSnapshots_Task*
    /// - *VirtualMachine.RevertToCurrentSnapshot_Task*
    /// - *VirtualMachine.MarkAsTemplate*
    /// - *VirtualMachine.MarkAsVirtualMachine*
    /// - *VirtualMachine.ResetGuestInformation*
    /// - *VirtualMachine.MountToolsInstaller*
    /// - *VirtualMachine.UnmountToolsInstaller*
    /// - *ManagedEntity.Destroy_Task*
    /// - *VirtualMachine.UpgradeVM_Task*
    /// - *VirtualMachine.ExportVm*
    ///   
    /// This list may include the following operations for a ResourcePool:
    /// - *ResourcePool.ImportVApp*
    /// - *ResourcePool.CreateChildVM_Task*
    /// - *ResourcePool.UpdateConfig*
    /// - *Folder.CreateVM_Task*
    /// - *ManagedEntity.Destroy_Task*
    /// - *ManagedEntity.Rename_Task*
    ///   
    /// This list may include the following operations for a VirtualApp:
    /// - *ManagedEntity.Destroy_Task*
    /// - *VirtualApp.CloneVApp_Task*
    /// - *VirtualApp.unregisterVApp_Task*
    /// - *VirtualApp.ExportVApp*
    /// - *VirtualApp.PowerOnVApp_Task*
    /// - *VirtualApp.PowerOffVApp_Task*
    /// - *VirtualApp.UpdateVAppConfig*
    ///   
    /// In releases after vSphere API 5.0, vSphere Servers might not
    /// generate property collector update notifications for this property.
    /// To obtain the latest value of the property, you can use
    /// PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx.
    /// If you use the PropertyCollector.WaitForUpdatesEx method, specify
    /// an empty string for the version parameter. Any other version value will not
    /// produce any property values as no updates are generated.
    pub async fn disabled_method(&self) -> Result<Option<Vec<String>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "disabledMethod").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Access rights the current session has to this entity.
    /// 
    /// ***Required privileges:*** System.View
    pub async fn effective_role(&self) -> Result<Option<Vec<i32>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "effectiveRole").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Hardware configuration of the host.
    /// 
    /// This might not be available for a
    /// disconnected host.
    pub async fn hardware(&self) -> Result<Option<crate::types::structs::HostHardwareInfo>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "hardware").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Information about all licensable resources, currently present on this host.
    /// 
    /// This information is used mostly by the modules, manipulating information
    /// in the *LicenseManager*. Developers of such modules
    /// should use this property instead of *hardware*.
    /// 
    /// NOTE:
    /// The values in this property may not be accurate for pre-5.0 hosts when returned by vCenter 5.0
    pub async fn licensable_resource(&self) -> Result<crate::types::structs::HostLicensableResourceInfo> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "licensableResource").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property licensableResource was empty".to_string()))?;
        let result: crate::types::structs::HostLicensableResourceInfo = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// Name of this entity, unique relative to its parent.
    /// 
    /// Any / (slash), \\ (backslash), character used in this
    /// name element will be escaped. Similarly, any % (percent) character used in
    /// this name element will be escaped, unless it is used to start an escape
    /// sequence. A slash is escaped as %2F or %2f. A backslash is escaped as %5C or
    /// %5c, and a percent is escaped as %25.
    /// 
    /// ***Required privileges:*** System.View
    pub async fn name(&self) -> Result<String> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "name").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property name was empty".to_string()))?;
        let result: String = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// A collection of references to the subset of network objects in the datacenter that
    /// are available in this HostSystem.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Returns:
    ///
    /// Refers instances of *Network*.
    pub async fn network(&self) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "network").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// General health of this managed entity.
    /// 
    /// The overall status of the managed entity is computed as the worst status
    /// among its alarms and the configuration issues detected on the entity.
    /// The status is reported as one of the following values:
    /// - red: The entity has alarms or configuration issues with a red status.
    /// - yellow: The entity does not have alarms or configuration issues with a
    ///   red status, and has at least one with a yellow status.
    /// - green: The entity does not have alarms or configuration issues with a
    ///   red or yellow status, and has at least one with a green status.
    /// - gray: All of the entity's alarms have a gray status and the
    ///   configuration status of the entity is not being monitored.
    ///   
    /// In releases after vSphere API 5.0, vSphere Servers might not
    /// generate property collector update notifications for this property.
    /// To obtain the latest value of the property, you can use
    /// PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx.
    /// If you use the PropertyCollector.WaitForUpdatesEx method, specify
    /// an empty string for the version parameter. Any other version value will not
    /// produce any property values as no updates are generated.
    pub async fn overall_status(&self) -> Result<crate::types::enums::ManagedEntityStatusEnum> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "overallStatus").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property overallStatus was empty".to_string()))?;
        let result: crate::types::enums::ManagedEntityStatusEnum = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// Parent of this entity.
    /// 
    /// This value is null for the root object and for
    /// *VirtualMachine* objects that are part of
    /// a *VirtualApp*.
    /// 
    /// ***Required privileges:*** System.View
    ///
    /// ## Returns:
    ///
    /// Refers instance of *ManagedEntity*.
    pub async fn parent(&self) -> Result<Option<crate::types::structs::ManagedObjectReference>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "parent").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// List of permissions defined for this entity.
    pub async fn permission(&self) -> Result<Option<Vec<crate::types::structs::Permission>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "permission").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// The host profile precheck-remediation result.
    pub async fn precheck_remediation_result(&self) -> Result<Option<crate::types::structs::ApplyHostProfileConfigurationSpec>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "precheckRemediationResult").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// The set of recent tasks operating on this managed entity.
    /// 
    /// This is a subset
    /// of *TaskManager.recentTask* belong to this entity. A task in this
    /// list could be in one of the four states: pending, running, success or error.
    /// 
    /// This property can be used to deduce intermediate power states for
    /// a virtual machine entity. For example, if the current powerState is "poweredOn"
    /// and there is a running task performing the "suspend" operation, then the virtual
    /// machine's intermediate state might be described as "suspending."
    /// 
    /// Most tasks (such as power operations) obtain exclusive access to the virtual
    /// machine, so it is unusual for this list to contain more than one running task.
    /// One exception, however, is the task of cloning a virtual machine.
    /// In releases after vSphere API 5.0, vSphere Servers might not
    /// generate property collector update notifications for this property.
    /// To obtain the latest value of the property, you can use
    /// PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx.
    /// If you use the PropertyCollector.WaitForUpdatesEx method, specify
    /// an empty string for the version parameter. Any other version value will not
    /// produce any property values as no updates are generated.
    ///
    /// ## Returns:
    ///
    /// Refers instances of *Task*.
    pub async fn recent_task(&self) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "recentTask").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// The host profile remediation result.
    pub async fn remediation_result(&self) -> Result<Option<crate::types::structs::ApplyHostProfileConfigurationResult>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "remediationResult").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// The host profile remediation state.
    pub async fn remediation_state(&self) -> Result<Option<crate::types::structs::HostSystemRemediationState>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "remediationState").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Runtime state information about the host such as connection state.
    pub async fn runtime(&self) -> Result<crate::types::structs::HostRuntimeInfo> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "runtime").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property runtime was empty".to_string()))?;
        let result: crate::types::structs::HostRuntimeInfo = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// Basic information about the host, including connection state.
    pub async fn summary(&self) -> Result<crate::types::structs::HostListSummary> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "summary").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property summary was empty".to_string()))?;
        let result: crate::types::structs::HostListSummary = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// Reference for the system resource hierarchy, used for configuring the set of
    /// resources reserved to the system and unavailable to virtual machines.
    pub async fn system_resources(&self) -> Result<Option<crate::types::structs::HostSystemResourceInfo>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "systemResources").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// The set of tags associated with this managed entity.
    /// 
    /// Experimental. Subject to change.
    /// 
    /// ***Required privileges:*** System.View
    pub async fn tag(&self) -> Result<Option<Vec<crate::types::structs::Tag>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "tag").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// A set of alarm states for alarms triggered by this entity
    /// or by its descendants.
    /// 
    /// Triggered alarms are propagated up the inventory hierarchy
    /// so that a user can readily tell when a descendant has triggered an alarm.
    /// In releases after vSphere API 5.0, vSphere Servers might not
    /// generate property collector update notifications for this property.
    /// To obtain the latest value of the property, you can use
    /// PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx.
    /// If you use the PropertyCollector.WaitForUpdatesEx method, specify
    /// an empty string for the version parameter. Any other version value will not
    /// produce any property values as no updates are generated.
    /// 
    /// ***Required privileges:*** System.View
    pub async fn triggered_alarm_state(&self) -> Result<Option<Vec<crate::types::structs::AlarmState>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "triggeredAlarmState").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// List of custom field values.
    /// 
    /// Each value uses a key to associate
    /// an instance of a *CustomFieldStringValue* with
    /// a custom field definition.
    /// 
    /// ***Required privileges:*** System.View
    pub async fn value(&self) -> Result<Option<Vec<Box<dyn crate::types::traits::CustomFieldValueTrait>>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "value").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// List of virtual machines associated with this host.
    ///
    /// ## Returns:
    ///
    /// Refers instances of *VirtualMachine*.
    pub async fn vm(&self) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let pv_opt = self.client.fetch_property_raw("", "HostSystem", &self.mo_id, "vm").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
}
struct ConfigureCryptoKeyRequestType<'a> {
    key_id: Option<&'a crate::types::structs::CryptoKeyId>,
}

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

struct ConfigureCryptoKeyRequestTypeSer<'b, 'a> {
    data: &'b ConfigureCryptoKeyRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ConfigureCryptoKeyRequestTypeSer<'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"), &"ConfigureCryptoKeyRequestType")),
                1 => {
                    let Some(ref val) = self.data.key_id else { continue; };
                    return Some((std::borrow::Cow::Borrowed("keyId"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct EnableCryptoRequestType<'a> {
    key_plain: &'a crate::types::structs::CryptoKeyPlain,
}

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

struct EnableCryptoRequestTypeSer<'b, 'a> {
    data: &'b EnableCryptoRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for EnableCryptoRequestTypeSer<'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"), &"EnableCryptoRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("keyPlain"), &self.data.key_plain as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct EnterMaintenanceModeRequestType<'a> {
    timeout: i32,
    evacuate_powered_off_vms: Option<bool>,
    maintenance_spec: Option<&'a crate::types::structs::HostMaintenanceSpec>,
}

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

struct EnterMaintenanceModeRequestTypeSer<'b, 'a> {
    data: &'b EnterMaintenanceModeRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for EnterMaintenanceModeRequestTypeSer<'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"), &"EnterMaintenanceModeRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("timeout"), &self.data.timeout as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.evacuate_powered_off_vms else { continue; };
                    return Some((std::borrow::Cow::Borrowed("evacuatePoweredOffVms"), val as &dyn miniserde::Serialize));
                }
                3 => {
                    let Some(ref val) = self.data.maintenance_spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("maintenanceSpec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct PowerDownHostToStandByRequestType {
    timeout_sec: i32,
    evacuate_powered_off_vms: Option<bool>,
}

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

struct PowerDownHostToStandByRequestTypeSer<'b> {
    data: &'b PowerDownHostToStandByRequestType,
    seq: usize,
}

impl<'b> miniserde::ser::Map for PowerDownHostToStandByRequestTypeSer<'b> {
    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"), &"PowerDownHostToStandByRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("timeoutSec"), &self.data.timeout_sec as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.evacuate_powered_off_vms else { continue; };
                    return Some((std::borrow::Cow::Borrowed("evacuatePoweredOffVms"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct ExitMaintenanceModeRequestType {
    timeout: i32,
}

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

struct ExitMaintenanceModeRequestTypeSer<'b> {
    data: &'b ExitMaintenanceModeRequestType,
    seq: usize,
}

impl<'b> miniserde::ser::Map for ExitMaintenanceModeRequestTypeSer<'b> {
    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"), &"ExitMaintenanceModeRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("timeout"), &self.data.timeout as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PowerUpHostFromStandByRequestType {
    timeout_sec: i32,
}

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

struct PowerUpHostFromStandByRequestTypeSer<'b> {
    data: &'b PowerUpHostFromStandByRequestType,
    seq: usize,
}

impl<'b> miniserde::ser::Map for PowerUpHostFromStandByRequestTypeSer<'b> {
    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"), &"PowerUpHostFromStandByRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("timeoutSec"), &self.data.timeout_sec as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryMemoryOverheadRequestType {
    memory_size: i64,
    video_ram_size: Option<i32>,
    num_vcpus: i32,
}

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

struct QueryMemoryOverheadRequestTypeSer<'b> {
    data: &'b QueryMemoryOverheadRequestType,
    seq: usize,
}

impl<'b> miniserde::ser::Map for QueryMemoryOverheadRequestTypeSer<'b> {
    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"), &"QueryMemoryOverheadRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("memorySize"), &self.data.memory_size as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.video_ram_size else { continue; };
                    return Some((std::borrow::Cow::Borrowed("videoRamSize"), val as &dyn miniserde::Serialize));
                }
                3 => return Some((std::borrow::Cow::Borrowed("numVcpus"), &self.data.num_vcpus as &dyn miniserde::Serialize)),
                _ => return None,
            }
        }
    }
}
struct QueryMemoryOverheadExRequestType<'a> {
    vm_config_info: &'a crate::types::structs::VirtualMachineConfigInfo,
}

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

struct QueryMemoryOverheadExRequestTypeSer<'b, 'a> {
    data: &'b QueryMemoryOverheadExRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryMemoryOverheadExRequestTypeSer<'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"), &"QueryMemoryOverheadExRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("vmConfigInfo"), &self.data.vm_config_info as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct RebootHostRequestType {
    force: bool,
}

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

struct RebootHostRequestTypeSer<'b> {
    data: &'b RebootHostRequestType,
    seq: usize,
}

impl<'b> miniserde::ser::Map for RebootHostRequestTypeSer<'b> {
    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"), &"RebootHostRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("force"), &self.data.force as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct ReconnectHostRequestType<'a> {
    cnx_spec: Option<&'a crate::types::structs::HostConnectSpec>,
    reconnect_spec: Option<&'a crate::types::structs::HostSystemReconnectSpec>,
}

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

struct ReconnectHostRequestTypeSer<'b, 'a> {
    data: &'b ReconnectHostRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ReconnectHostRequestTypeSer<'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"), &"ReconnectHostRequestType")),
                1 => {
                    let Some(ref val) = self.data.cnx_spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("cnxSpec"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.reconnect_spec else { continue; };
                    return Some((std::borrow::Cow::Borrowed("reconnectSpec"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct RenameRequestType<'a> {
    new_name: &'a str,
}

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

struct RenameRequestTypeSer<'b, 'a> {
    data: &'b RenameRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RenameRequestTypeSer<'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"), &"RenameRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("newName"), &self.data.new_name as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct SetCustomValueRequestType<'a> {
    key: &'a str,
    value: &'a str,
}

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

struct SetCustomValueRequestTypeSer<'b, 'a> {
    data: &'b SetCustomValueRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for SetCustomValueRequestTypeSer<'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"), &"setCustomValueRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("key"), &self.data.key as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("value"), &self.data.value as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct ShutdownHostRequestType {
    force: bool,
}

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

struct ShutdownHostRequestTypeSer<'b> {
    data: &'b ShutdownHostRequestType,
    seq: usize,
}

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

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

struct UpdateFlagsRequestTypeSer<'b, 'a> {
    data: &'b UpdateFlagsRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for UpdateFlagsRequestTypeSer<'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"), &"UpdateFlagsRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("flagInfo"), &self.data.flag_info as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct UpdateIpmiRequestType<'a> {
    ipmi_info: &'a crate::types::structs::HostIpmiInfo,
}

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

struct UpdateIpmiRequestTypeSer<'b, 'a> {
    data: &'b UpdateIpmiRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for UpdateIpmiRequestTypeSer<'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"), &"UpdateIpmiRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("ipmiInfo"), &self.data.ipmi_info as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct UpdateProductLockerLocationRequestType<'a> {
    path: &'a str,
}

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

struct UpdateProductLockerLocationRequestTypeSer<'b, 'a> {
    data: &'b UpdateProductLockerLocationRequestType<'a>,
    seq: usize,
}

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

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

struct UpdateSystemResourcesRequestTypeSer<'b, 'a> {
    data: &'b UpdateSystemResourcesRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for UpdateSystemResourcesRequestTypeSer<'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"), &"UpdateSystemResourcesRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("resourceInfo"), &self.data.resource_info as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct UpdateSystemSwapConfigurationRequestType<'a> {
    sys_swap_config: &'a crate::types::structs::HostSystemSwapConfiguration,
}

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

struct UpdateSystemSwapConfigurationRequestTypeSer<'b, 'a> {
    data: &'b UpdateSystemSwapConfigurationRequestType<'a>,
    seq: usize,
}

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