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
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// The *PbmProfileProfileManager* supports operations on virtual machine storage profiles.
/// 
/// A Storage Policy API profile consists of a set of _subprofiles_.
/// A subprofile corresponds to a _rule set_ in the vSphere Web Client.
/// 
/// Virtual machine storage profiles specify the storage requirements
/// for virtual machine files. You use the vSphere Web Client to define virtual machine
/// storage profiles. The requirements
/// (*PbmCapabilityProfile*.*PbmCapabilityProfile.constraints*)
/// impose constraints on the placement of virtual machine files.
/// 
/// The Storage Policy Server also supports datastore profiles. Datastore profiles
/// define storage capabilities. Storage capabilities are resources defined by
/// storage providers. Storage requirements are based on storage capabilities.
/// When you associate a storage profile with a virtual machine or virtual disk,
/// the Server sends the profile to the storage provider. When you perform compliance
/// checking (*PbmComplianceManager*), the storage provider
/// compares the requirements with the capabilities.
/// 
/// The *PbmProfileProfileManager* supports the following operations on
/// virtual machine storage profiles.
/// - Create, update, and delete storage profiles.
/// - Retrieve profile data based on specified criteria.
/// - Retrieve storage vendor data.
///   
/// The following figure shows the set of data objects that comprise
/// a storage profile specification (*PbmCapabilityProfileCreateSpec*).
/// You pass a storage profile specification to the Storage Policy Server
/// when you call the following methods:
/// - *PbmProfileProfileManager*.*PbmProfileProfileManager.PbmCreate*
/// - *PbmPlacementSolver*.*PbmPlacementSolver.PbmCheckCompatibilityWithSpec*
/// - *PbmPlacementSolver*.*PbmPlacementSolver.PbmQueryMatchingHubWithSpec*
/// <!-- -->
///      +---------------------------------+
///      |  PbmCapabilityProfileCreateSpec |
///      |                            name |     +-------------------------+
///      |                     description |     |  PbmProfileResourceType |
///      |                    resourceType ------|    resourceType=STORAGE |
///      |                     constraints ---   +-------------------------+
///      +---------------------------------+ |
///                                          |
///                                          |
///             +------------------------------------+
///             | PbmCapabilitySubProfileConstraints |
///             |                        subprofiles ---
///             +------------------------------------+ |
///                                                    | 1..n
///                                                    |
///                               +-------------------------+
///                               | PbmCapabilitySubProfile |
///                               |                    name |
///                               |          forceProvision |
///                               |              capability ---
///                               +-------------------------+ |
///                                                           | 1..n            +-------------------------------+
///                                                           |                 | PbmCapabilityMetadataUniqueId |
///                                         +-----------------------+           |                            id |
///                                         | PbmCapabilityInstance |           |                     namespace |
///                                         |                    id ------------+-------------------------------+
///                                         |            constraint ---
///                                         +-----------------------+ |
///                                                                   | 1..n
///                                                                   |                +-------------------------------+
///                                        +---------------------------------+         | PbmCapabilityPropertyInstance |
///                                        | PbmCapabilityConstraintInstance |  1..n   |                            id |
///                                        |                propertyInstance ----------|                         value |
///                                        +---------------------------------+         +-------------------------------+
#[derive(Clone)]
pub struct PbmProfileProfileManager {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl PbmProfileProfileManager {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// Assign the given profile as the default profile for the given datastores.
    /// 
    /// This is an atomic operation. Either all the datastores will be assigned
    /// the default profile or none will be.
    /// In addition to StorageProfile.Update privilege, it requires
    /// Datastore.UpdateVirtualMachineFiles privilege on the given datastores to
    /// change the default profile for the datastores. Otherwise a NoPermission
    /// fault is thrown.
    /// 
    /// ***Required privileges:*** StorageProfile.Update
    ///
    /// ## Parameters:
    ///
    /// ### profile
    /// The profile that needs to be made default profile.
    ///
    /// ### datastores
    /// The datastores for which the profile needs to be made as default profile.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: If one of the hub is not a datastore or profile cannot be
    /// used as default requirement profile for any of the hub.
    /// 
    /// ***PbmLegacyHubsNotSupported***: If any of the hub in datastores argument is legacy (VMFS
    /// or NFS) datastores.
    /// 
    /// ***PbmNonExistentHubs***: If any of the hub in datastores argument is non existent.
    /// 
    /// ***PbmFault***: Internal service error
    /// 
    /// ***PbmFaultNoPermission***: If user does not have Datastore.UpdateVirtualMachineFiles
    /// privilege on the given datastores.
    pub async fn pbm_assign_default_requirement_profile(&self, profile: &crate::types::structs::PbmProfileId, datastores: &[crate::types::structs::PbmPlacementHub]) -> Result<()> {
        let input = PbmAssignDefaultRequirementProfileRequestType {profile, datastores, };
        self.client.invoke_void("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmAssignDefaultRequirementProfile", Some(&input)).await
    }
    /// Creates a capability-based storage profile.
    /// 
    /// A capability-based profile
    /// contains requirements that are derived from tag-defined capabilities
    /// or from VMware VSAN capabilities.
    /// - Use the vSphere Web Client to define tags for capabilities.
    /// - VSAN storage capabilities are system-defined.
    ///   
    /// A profile is a collection of subprofiles
    /// (*PbmCapabilitySubProfile*).
    /// A subprofile references storage capabilities and defines requirements
    /// based on those capabilities.
    /// 
    /// To define a storage requirement, you specify constraint property instance values
    /// (*PbmCapabilityPropertyInstance*) that use Storage Policy API builtin
    /// types (*PbmBuiltinType_enum*) to create expressions
    /// for compliance checking.
    /// 
    /// The profile specification contains lists of constraint property instances
    /// (*PbmCapabilityProfileCreateSpec*.*PbmCapabilityProfileCreateSpec.constraints*.*PbmCapabilitySubProfileConstraints.subProfiles*\[\].*PbmCapabilitySubProfile.capability*\[\].*PbmCapabilityInstance.constraint*\[\].*PbmCapabilityConstraintInstance.propertyInstance*\[\]).
    /// The constraints are based on storage capabilities described in metadata
    /// (*PbmCapabilityPropertyMetadata*) and in the datastore profiles.
    /// 
    /// ***Required privileges:*** StorageProfile.Update
    ///
    /// ## Parameters:
    ///
    /// ### create_spec
    /// Capability-based profile specification.
    ///
    /// ## Returns:
    ///
    /// Identifier for the new profile.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if
    /// *PbmCapabilityProfileCreateSpec* is invalid.
    /// 
    /// ***PbmFaultProfileStorageFault***: if there is an error in persisting the profile.
    /// 
    /// ***PbmDuplicateName***: if a profile with the same name already exists.
    pub async fn pbm_create(&self, create_spec: &crate::types::structs::PbmCapabilityProfileCreateSpec) -> Result<crate::types::structs::PbmProfileId> {
        let input = PbmCreateRequestType {create_spec, };
        let bytes = self.client.invoke("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmCreate", Some(&input)).await?;
        let result: crate::types::structs::PbmProfileId = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deletes one or more profiles.
    /// 
    /// If the method successfully deletes a
    /// profile, its identifier is no longer valid.
    /// 
    /// ***Required privileges:*** StorageProfile.Update
    ///
    /// ## Parameters:
    ///
    /// ### profile_id
    /// Array of profile identifiers.
    ///
    /// ## Returns:
    ///
    /// Array of result objects, one for each profile specified in the
    /// call to the <code>PbmDelete</code> method.
    /// 
    /// The result object contains the profile ID and, if an error
    /// occurred, it also describes the fault. The method can return one
    /// of the following faults if the profile cannot be deleted:
    /// - *InvalidArgument* - Profile is not
    ///   recognized by the system.
    /// - *PbmFaultProfileStorageFault* - Internal service
    ///   error.
    /// - *PbmResourceInUse* - Profile is still associated
    ///   with an entity.
    pub async fn pbm_delete(&self, profile_id: &[crate::types::structs::PbmProfileId]) -> Result<Option<Vec<crate::types::structs::PbmProfileOperationOutcome>>> {
        let input = PbmDeleteRequestType {profile_id, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmDelete", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Retrieves capability metadata.
    /// 
    /// Each capability metadata object has a unique identifier
    /// (*PbmCapabilityMetadata*.*PbmCapabilityMetadata.id*).
    /// The identifier object (*PbmCapabilityMetadataUniqueId*)
    /// contains the unique ID and it identifies the namespace to which
    /// the capability metadata object belongs.
    /// 
    /// Each registered namespace is required to be globally unique.
    /// You can associate a capability metadata object with a unique vendor and
    /// resource type by using the namespace and the
    /// *PbmCapabilityVendorResourceTypeInfo*
    /// data returned by the *PbmProfileProfileManager.PbmFetchVendorInfo* method.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### resource_type
    /// Type of profile resource. The Server supports the "STORAGE" resource
    /// type only. If not specified, this method will return capability metadata for the storage
    /// resources. Any other <code>resourceType</code> is considered invalid.
    ///
    /// ### vendor_uuid
    /// Unique identifier for the vendor/owner of capability
    /// metadata. The specified vendor ID must match
    /// *PbmCapabilitySchemaVendorInfo*.*PbmCapabilitySchemaVendorInfo.vendorUuid*.
    /// If omitted, the Server searchs all capability metadata registered with the system. If a
    /// <code>vendorUuid</code> unknown to the Server is specified, empty results will be returned.
    ///
    /// ## Returns:
    ///
    /// Array of capability metadata objects, classified by category
    /// (*PbmCapabilityMetadataPerCategory*.*PbmCapabilityMetadataPerCategory.subCategory*).
    pub async fn pbm_fetch_capability_metadata(&self, resource_type: Option<&crate::types::structs::PbmProfileResourceType>, vendor_uuid: Option<&str>) -> Result<Option<Vec<crate::types::structs::PbmCapabilityMetadataPerCategory>>> {
        let input = PbmFetchCapabilityMetadataRequestType {resource_type, vendor_uuid, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmFetchCapabilityMetadata", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Returns the capability schema objects registered in the system.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### vendor_uuid
    /// Unique identifier for the vendor/owner of capability metadata.
    /// If omitted, the server searchs all capability metadata registered
    /// with the system. The specified vendor ID must match
    /// *PbmCapabilitySchemaVendorInfo*.*PbmCapabilitySchemaVendorInfo.vendorUuid*.
    ///
    /// ### line_of_service
    /// Optional line of service that must match *PbmLineOfServiceInfoLineOfServiceEnum_enum*.
    /// If specified, the capability schema objects
    /// are returned for the given lineOfServices. If null, then all
    /// capability schema objects that may or may not have data service capabilities
    /// are returned.
    ///
    /// ## Returns:
    ///
    /// Array of *PbmCapabilitySchema*
    ///
    /// ## Errors:
    ///
    /// ***PbmFault***: If there is an internal server error.
    /// 
    /// ***InvalidArgument***: If input lineOfServices has unknown/invalid line of service.
    pub async fn pbm_fetch_capability_schema(&self, vendor_uuid: Option<&str>, line_of_service: Option<&[String]>) -> Result<Option<Vec<crate::types::structs::PbmCapabilitySchema>>> {
        let input = PbmFetchCapabilitySchemaRequestType {vendor_uuid, line_of_service, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmFetchCapabilitySchema", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Retrieves information about various resource types registered with the system.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Returns:
    ///
    /// Array of resource types.
    pub async fn pbm_fetch_resource_type(&self) -> Result<Option<Vec<crate::types::structs::PbmProfileResourceType>>> {
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmFetchResourceType", None).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Retrieve information about various capability metadata owners/vendors
    /// registered with the system, the resource type for which they are registered,
    /// and schema namespaces to which they belong.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### resource_type
    /// Specifies the resource type. The Server supports the STORAGE resource
    /// type only. If not specified, server defaults to STORAGE resource type. Any other
    /// <code>resourceType</code> is considered invalid.
    ///
    /// ## Returns:
    ///
    /// Vendor and namespace information.
    pub async fn pbm_fetch_vendor_info(&self, resource_type: Option<&crate::types::structs::PbmProfileResourceType>) -> Result<Option<Vec<crate::types::structs::PbmCapabilityVendorResourceTypeInfo>>> {
        let input = PbmFetchVendorInfoRequestType {resource_type, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmFetchVendorInfo", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Returns the profiles that can be made as default profile for all the given datastores.
    /// 
    /// A profile can be made as a default profile for a datastore only if it contains a ruleset
    /// from the namespace the datastore belongs to.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### datastores
    /// Datastores for which the default profile is found out. Note that
    /// the datastore pods/clusters are not supported.
    ///
    /// ## Returns:
    ///
    /// Profile\[\]
    /// Returns all the requirements profiles that can be made as default profile for the given datastores.
    /// If no profile can be made as default for all datastores, then an empty array is returned.
    /// Note that the profiles returned may or may not be compatible with the datastores.
    ///
    /// ## Errors:
    ///
    /// ***PbmLegacyHubsNotSupported***: If any of the hubs in datastores argument are legacy (VMFS or NFS) datastores.
    /// 
    /// ***PbmNonExistentHubs***: If any of the hubs in datastores argument are non existent.
    /// 
    /// ***PbmFault***: Internal service error.
    /// 
    /// ***InvalidArgument***: If the datastores argument contains a non-datastore, example storage pod.
    pub async fn pbm_find_applicable_default_profile(&self, datastores: &[crate::types::structs::PbmPlacementHub]) -> Result<Option<Vec<Box<dyn crate::types::traits::PbmProfileTrait>>>> {
        let input = PbmFindApplicableDefaultProfileRequestType {datastores, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmFindApplicableDefaultProfile", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Returns the virtual machine and disks that are associated with the given
    /// storage policies.
    /// 
    /// If the profiles parameter is empty, then this API returns
    /// all the virtual machine and disks that are associated with some storage
    /// policy.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### profiles
    /// Storage policy array.
    ///
    /// ## Returns:
    ///
    /// Array of QueryProfileResult
    ///
    /// ## Errors:
    ///
    /// ***PbmFault***: If there is an internal service error.
    pub async fn pbm_query_associated_entities(&self, profiles: Option<&[crate::types::structs::PbmProfileId]>) -> Result<Option<Vec<crate::types::structs::PbmQueryProfileResult>>> {
        let input = PbmQueryAssociatedEntitiesRequestType {profiles, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmQueryAssociatedEntities", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Retrieves entities associated with the specified profile.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### profile
    /// Profile identifier.
    ///
    /// ### entity_type
    /// If specified, the method returns only those entities
    /// which match the type. The <code>entityType</code> string value must match
    /// one of the *PbmObjectType_enum* values.
    /// If not specified, the method returns all entities associated with the profile.
    ///
    /// ## Returns:
    ///
    /// Array of entities associated with the profile.
    ///
    /// ## Errors:
    ///
    /// ***PbmFault***: If there is an internal server error.
    pub async fn pbm_query_associated_entity(&self, profile: &crate::types::structs::PbmProfileId, entity_type: Option<&str>) -> Result<Option<Vec<crate::types::structs::PbmServerObjectRef>>> {
        let input = PbmQueryAssociatedEntityRequestType {profile, entity_type, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmQueryAssociatedEntity", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Returns identifiers for profiles associated with a virtual machine,
    /// virtual disk, or datastore.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### entity
    /// Reference to a virtual machine, virtual disk, or datastore.
    ///
    /// ## Returns:
    ///
    /// Array of profiles associated with the entity.
    ///
    /// ## Errors:
    ///
    /// ***PbmFault***: If there is an internal server error.
    pub async fn pbm_query_associated_profile(&self, entity: &crate::types::structs::PbmServerObjectRef) -> Result<Option<Vec<crate::types::structs::PbmProfileId>>> {
        let input = PbmQueryAssociatedProfileRequestType {entity, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmQueryAssociatedProfile", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Returns profiles associated with the specified entities.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### entities
    /// Array of server object references.
    ///
    /// ## Returns:
    ///
    /// Array of query result objects. Each *PbmQueryProfileResult*
    /// object identifies a virtual machine, virtual disk, or datastore
    /// and it contains a list of the profiles associated with that entity.
    /// It also describes the fault, if there is an error associated
    /// with one of the profiles.
    ///
    /// ## Errors:
    ///
    /// ***PbmFault***: If there is an internal server error.
    pub async fn pbm_query_associated_profiles(&self, entities: &[crate::types::structs::PbmServerObjectRef]) -> Result<Option<Vec<crate::types::structs::PbmQueryProfileResult>>> {
        let input = PbmQueryAssociatedProfilesRequestType {entities, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmQueryAssociatedProfiles", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Returns the default requirement profile ID for the given datastore.
    /// 
    /// For
    /// legacy hub the API returns `null`.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### hub
    /// Placement hub (i.e. datastore).
    ///
    /// ## Returns:
    ///
    /// Profile Id of the Default Requirement Profile. For legacy hub the
    /// API returns `null`.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: If hub is invalid (does not denote a datastore).
    /// 
    /// ***PbmNonExistentHubs***: If hub is non existent.
    /// 
    /// ***PbmFault***: Internal service error.
    pub async fn pbm_query_default_requirement_profile(&self, hub: &crate::types::structs::PbmPlacementHub) -> Result<Option<crate::types::structs::PbmProfileId>> {
        let input = PbmQueryDefaultRequirementProfileRequestType {hub, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmQueryDefaultRequirementProfile", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Returns the default profiles for the given datastores.
    /// 
    /// For legacy
    /// datastores we set `DefaultProfileInfo.defaultProfile` to
    /// `null`.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### datastores
    /// The datastores for which the default profiles are requested. For
    /// legacy datastores we set
    /// `DefaultProfileInfo.defaultProfile` to `null`.
    ///
    /// ## Returns:
    ///
    /// DefaultProfileInfo Default profile information.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: If one of the datastore is invalid (does not denote a
    /// datastore).
    /// 
    /// ***PbmNonExistentHubs***: If any of the datastore in datastores argument are non
    /// existent.
    /// 
    /// ***PbmFault***: Internal service error.
    pub async fn pbm_query_default_requirement_profiles(&self, datastores: &[crate::types::structs::PbmPlacementHub]) -> Result<Vec<crate::types::structs::PbmDefaultProfileInfo>> {
        let input = PbmQueryDefaultRequirementProfilesRequestType {datastores, };
        let bytes = self.client.invoke("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmQueryDefaultRequirementProfiles", Some(&input)).await?;
        let result: Vec<crate::types::structs::PbmDefaultProfileInfo> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Returns requirement profile ids or resource profile ids, or both.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### resource_type
    /// Type of resource. You can specify only STORAGE.
    ///
    /// ### profile_category
    /// Profile category. The string value must correspond
    /// to one of the *PbmProfileCategoryEnum_enum* values.
    /// If you do not specify a profile category, the method returns profiles in all
    /// categories.
    ///
    /// ## Returns:
    ///
    /// Array of storage profile identifiers.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if the Server does not recognize the specified
    /// resourceType or profileCategory.
    pub async fn pbm_query_profile(&self, resource_type: &crate::types::structs::PbmProfileResourceType, profile_category: Option<&str>) -> Result<Option<Vec<crate::types::structs::PbmProfileId>>> {
        let input = PbmQueryProfileRequestType {resource_type, profile_category, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmQueryProfile", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Retrieves space statistics of a datastore.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### datastore
    /// Entity for which space statistics are being requested i.e datastore.
    ///
    /// ### capability_profile_id
    /// \- capability profile Ids.
    /// If omitted, the statistics for the container
    /// as a whole would be returned.
    ///
    /// ## Returns:
    ///
    /// Array of Space stats of datastore for each capabilityProfileId.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: - Thrown if the input datastore parameter is null
    /// or its type is not datastore or its key is empty.
    /// 
    /// ***PbmFault***: - Thrown if server internal error occurred or
    /// if storage container does not support the profile.
    pub async fn pbm_query_space_stats_for_storage_container(&self, datastore: &crate::types::structs::PbmServerObjectRef, capability_profile_id: Option<&[crate::types::structs::PbmProfileId]>) -> Result<Option<Vec<crate::types::structs::PbmDatastoreSpaceStatistics>>> {
        let input = PbmQuerySpaceStatsForStorageContainerRequestType {datastore, capability_profile_id, };
        let bytes_opt = self.client.invoke_optional("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmQuerySpaceStatsForStorageContainer", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Deprecated since it is not supported.
    /// 
    /// Not supported in this release.
    /// 
    /// ***Required privileges:*** StorageProfile.Update
    ///
    /// ## Parameters:
    ///
    /// ### profile
    /// Profile to reset.
    pub async fn pbm_reset_default_requirement_profile(&self, profile: Option<&crate::types::structs::PbmProfileId>) -> Result<()> {
        let input = PbmResetDefaultRequirementProfileRequestType {profile, };
        self.client.invoke_void("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmResetDefaultRequirementProfile", Some(&input)).await
    }
    /// Resets the system pre-created VSAN default profile to factory defaults.
    /// 
    /// ***Required privileges:*** StorageProfile.Update
    pub async fn pbm_reset_v_san_default_profile(&self) -> Result<()> {
        self.client.invoke_void("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmResetVSanDefaultProfile", None).await
    }
    /// Returns one or more storage profiles.
    /// 
    /// ***Required privileges:*** StorageProfile.View
    ///
    /// ## Parameters:
    ///
    /// ### profile_ids
    /// Array of storage profile identifiers.
    ///
    /// ## Returns:
    ///
    /// Array of storage profiles.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if the Server does not recognize any of the profileIds.
    pub async fn pbm_retrieve_content(&self, profile_ids: &[crate::types::structs::PbmProfileId]) -> Result<Vec<Box<dyn crate::types::traits::PbmProfileTrait>>> {
        let input = PbmRetrieveContentRequestType {profile_ids, };
        let bytes = self.client.invoke("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmRetrieveContent", Some(&input)).await?;
        let result: Vec<Box<dyn crate::types::traits::PbmProfileTrait>> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Updates a storage profile.
    /// 
    /// ***Required privileges:*** StorageProfile.Update
    ///
    /// ## Parameters:
    ///
    /// ### profile_id
    /// Profile identifier.
    ///
    /// ### update_spec
    /// Capability-based update specification.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: if the Server does not recognize *PbmProfileId*.
    /// 
    /// ***PbmFaultProfileStorageFault***: in case of internal service error.
    pub async fn pbm_update(&self, profile_id: &crate::types::structs::PbmProfileId, update_spec: &crate::types::structs::PbmCapabilityProfileUpdateSpec) -> Result<()> {
        let input = PbmUpdateRequestType {profile_id, update_spec, };
        self.client.invoke_void("pbm", "PbmProfileProfileManager", &self.mo_id, "PbmUpdate", Some(&input)).await
    }
}
struct PbmAssignDefaultRequirementProfileRequestType<'a> {
    profile: &'a crate::types::structs::PbmProfileId,
    datastores: &'a [crate::types::structs::PbmPlacementHub],
}

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

struct PbmAssignDefaultRequirementProfileRequestTypeSer<'b, 'a> {
    data: &'b PbmAssignDefaultRequirementProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmAssignDefaultRequirementProfileRequestTypeSer<'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"), &"PbmAssignDefaultRequirementProfileRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("profile"), &self.data.profile as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("datastores"), &self.data.datastores as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PbmCreateRequestType<'a> {
    create_spec: &'a crate::types::structs::PbmCapabilityProfileCreateSpec,
}

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

struct PbmCreateRequestTypeSer<'b, 'a> {
    data: &'b PbmCreateRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmCreateRequestTypeSer<'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"), &"PbmCreateRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("createSpec"), &self.data.create_spec as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PbmDeleteRequestType<'a> {
    profile_id: &'a [crate::types::structs::PbmProfileId],
}

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

struct PbmDeleteRequestTypeSer<'b, 'a> {
    data: &'b PbmDeleteRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmDeleteRequestTypeSer<'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"), &"PbmDeleteRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("profileId"), &self.data.profile_id as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PbmFetchCapabilityMetadataRequestType<'a> {
    resource_type: Option<&'a crate::types::structs::PbmProfileResourceType>,
    vendor_uuid: Option<&'a str>,
}

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

struct PbmFetchCapabilityMetadataRequestTypeSer<'b, 'a> {
    data: &'b PbmFetchCapabilityMetadataRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmFetchCapabilityMetadataRequestTypeSer<'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"), &"PbmFetchCapabilityMetadataRequestType")),
                1 => {
                    let Some(ref val) = self.data.resource_type else { continue; };
                    return Some((std::borrow::Cow::Borrowed("resourceType"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.vendor_uuid else { continue; };
                    return Some((std::borrow::Cow::Borrowed("vendorUuid"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct PbmFetchCapabilitySchemaRequestType<'a> {
    vendor_uuid: Option<&'a str>,
    line_of_service: Option<&'a [String]>,
}

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

struct PbmFetchCapabilitySchemaRequestTypeSer<'b, 'a> {
    data: &'b PbmFetchCapabilitySchemaRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmFetchCapabilitySchemaRequestTypeSer<'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"), &"PbmFetchCapabilitySchemaRequestType")),
                1 => {
                    let Some(ref val) = self.data.vendor_uuid else { continue; };
                    return Some((std::borrow::Cow::Borrowed("vendorUuid"), val as &dyn miniserde::Serialize));
                }
                2 => {
                    let Some(ref val) = self.data.line_of_service else { continue; };
                    return Some((std::borrow::Cow::Borrowed("lineOfService"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct PbmFetchVendorInfoRequestType<'a> {
    resource_type: Option<&'a crate::types::structs::PbmProfileResourceType>,
}

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

struct PbmFetchVendorInfoRequestTypeSer<'b, 'a> {
    data: &'b PbmFetchVendorInfoRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmFetchVendorInfoRequestTypeSer<'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"), &"PbmFetchVendorInfoRequestType")),
                1 => {
                    let Some(ref val) = self.data.resource_type else { continue; };
                    return Some((std::borrow::Cow::Borrowed("resourceType"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct PbmFindApplicableDefaultProfileRequestType<'a> {
    datastores: &'a [crate::types::structs::PbmPlacementHub],
}

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

struct PbmFindApplicableDefaultProfileRequestTypeSer<'b, 'a> {
    data: &'b PbmFindApplicableDefaultProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmFindApplicableDefaultProfileRequestTypeSer<'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"), &"PbmFindApplicableDefaultProfileRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("datastores"), &self.data.datastores as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PbmQueryAssociatedEntitiesRequestType<'a> {
    profiles: Option<&'a [crate::types::structs::PbmProfileId]>,
}

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

struct PbmQueryAssociatedEntitiesRequestTypeSer<'b, 'a> {
    data: &'b PbmQueryAssociatedEntitiesRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmQueryAssociatedEntitiesRequestTypeSer<'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"), &"PbmQueryAssociatedEntitiesRequestType")),
                1 => {
                    let Some(ref val) = self.data.profiles else { continue; };
                    return Some((std::borrow::Cow::Borrowed("profiles"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct PbmQueryAssociatedEntityRequestType<'a> {
    profile: &'a crate::types::structs::PbmProfileId,
    entity_type: Option<&'a str>,
}

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

struct PbmQueryAssociatedEntityRequestTypeSer<'b, 'a> {
    data: &'b PbmQueryAssociatedEntityRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmQueryAssociatedEntityRequestTypeSer<'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"), &"PbmQueryAssociatedEntityRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("profile"), &self.data.profile as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.entity_type else { continue; };
                    return Some((std::borrow::Cow::Borrowed("entityType"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct PbmQueryAssociatedProfileRequestType<'a> {
    entity: &'a crate::types::structs::PbmServerObjectRef,
}

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

struct PbmQueryAssociatedProfileRequestTypeSer<'b, 'a> {
    data: &'b PbmQueryAssociatedProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmQueryAssociatedProfileRequestTypeSer<'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"), &"PbmQueryAssociatedProfileRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("entity"), &self.data.entity as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PbmQueryAssociatedProfilesRequestType<'a> {
    entities: &'a [crate::types::structs::PbmServerObjectRef],
}

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

struct PbmQueryAssociatedProfilesRequestTypeSer<'b, 'a> {
    data: &'b PbmQueryAssociatedProfilesRequestType<'a>,
    seq: usize,
}

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

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

struct PbmQueryDefaultRequirementProfileRequestTypeSer<'b, 'a> {
    data: &'b PbmQueryDefaultRequirementProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmQueryDefaultRequirementProfileRequestTypeSer<'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"), &"PbmQueryDefaultRequirementProfileRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("hub"), &self.data.hub as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PbmQueryDefaultRequirementProfilesRequestType<'a> {
    datastores: &'a [crate::types::structs::PbmPlacementHub],
}

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

struct PbmQueryDefaultRequirementProfilesRequestTypeSer<'b, 'a> {
    data: &'b PbmQueryDefaultRequirementProfilesRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmQueryDefaultRequirementProfilesRequestTypeSer<'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"), &"PbmQueryDefaultRequirementProfilesRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("datastores"), &self.data.datastores as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PbmQueryProfileRequestType<'a> {
    resource_type: &'a crate::types::structs::PbmProfileResourceType,
    profile_category: Option<&'a str>,
}

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

struct PbmQueryProfileRequestTypeSer<'b, 'a> {
    data: &'b PbmQueryProfileRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmQueryProfileRequestTypeSer<'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"), &"PbmQueryProfileRequestType")),
                1 => return Some((std::borrow::Cow::Borrowed("resourceType"), &self.data.resource_type as &dyn miniserde::Serialize)),
                2 => {
                    let Some(ref val) = self.data.profile_category else { continue; };
                    return Some((std::borrow::Cow::Borrowed("profileCategory"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct PbmQuerySpaceStatsForStorageContainerRequestType<'a> {
    datastore: &'a crate::types::structs::PbmServerObjectRef,
    capability_profile_id: Option<&'a [crate::types::structs::PbmProfileId]>,
}

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

struct PbmQuerySpaceStatsForStorageContainerRequestTypeSer<'b, 'a> {
    data: &'b PbmQuerySpaceStatsForStorageContainerRequestType<'a>,
    seq: usize,
}

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

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

struct PbmResetDefaultRequirementProfileRequestTypeSer<'b, 'a> {
    data: &'b PbmResetDefaultRequirementProfileRequestType<'a>,
    seq: usize,
}

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

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

struct PbmRetrieveContentRequestTypeSer<'b, 'a> {
    data: &'b PbmRetrieveContentRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmRetrieveContentRequestTypeSer<'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"), &"PbmRetrieveContentRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("profileIds"), &self.data.profile_ids as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct PbmUpdateRequestType<'a> {
    profile_id: &'a crate::types::structs::PbmProfileId,
    update_spec: &'a crate::types::structs::PbmCapabilityProfileUpdateSpec,
}

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

struct PbmUpdateRequestTypeSer<'b, 'a> {
    data: &'b PbmUpdateRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for PbmUpdateRequestTypeSer<'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"), &"PbmUpdateRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("profileId"), &self.data.profile_id as &dyn miniserde::Serialize)),
            2 => return Some((std::borrow::Cow::Borrowed("updateSpec"), &self.data.update_spec as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}