github.com/vmware/govmomi@v0.51.0/internal/methods.go (about) 1 // © Broadcom. All Rights Reserved. 2 // The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. 3 // SPDX-License-Identifier: Apache-2.0 4 5 package internal 6 7 import ( 8 "context" 9 10 "github.com/vmware/govmomi/vim25/soap" 11 ) 12 13 type RetrieveDynamicTypeManagerBody struct { 14 Req *RetrieveDynamicTypeManagerRequest `xml:"urn:vim25 RetrieveDynamicTypeManager"` 15 Res *RetrieveDynamicTypeManagerResponse `xml:"urn:vim25 RetrieveDynamicTypeManagerResponse"` 16 Fault_ *soap.Fault 17 } 18 19 func (b *RetrieveDynamicTypeManagerBody) Fault() *soap.Fault { return b.Fault_ } 20 21 func RetrieveDynamicTypeManager(ctx context.Context, r soap.RoundTripper, req *RetrieveDynamicTypeManagerRequest) (*RetrieveDynamicTypeManagerResponse, error) { 22 var reqBody, resBody RetrieveDynamicTypeManagerBody 23 24 reqBody.Req = req 25 26 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 27 return nil, err 28 } 29 30 return resBody.Res, nil 31 } 32 33 type RetrieveManagedMethodExecuterBody struct { 34 Req *RetrieveManagedMethodExecuterRequest `xml:"urn:vim25 RetrieveManagedMethodExecuter"` 35 Res *RetrieveManagedMethodExecuterResponse `xml:"urn:vim25 RetrieveManagedMethodExecuterResponse"` 36 Fault_ *soap.Fault 37 } 38 39 func (b *RetrieveManagedMethodExecuterBody) Fault() *soap.Fault { return b.Fault_ } 40 41 func RetrieveManagedMethodExecuter(ctx context.Context, r soap.RoundTripper, req *RetrieveManagedMethodExecuterRequest) (*RetrieveManagedMethodExecuterResponse, error) { 42 var reqBody, resBody RetrieveManagedMethodExecuterBody 43 44 reqBody.Req = req 45 46 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 47 return nil, err 48 } 49 50 return resBody.Res, nil 51 } 52 53 type DynamicTypeMgrQueryMoInstancesBody struct { 54 Req *DynamicTypeMgrQueryMoInstancesRequest `xml:"urn:vim25 DynamicTypeMgrQueryMoInstances"` 55 Res *DynamicTypeMgrQueryMoInstancesResponse `xml:"urn:vim25 DynamicTypeMgrQueryMoInstancesResponse"` 56 Fault_ *soap.Fault 57 } 58 59 func (b *DynamicTypeMgrQueryMoInstancesBody) Fault() *soap.Fault { return b.Fault_ } 60 61 func DynamicTypeMgrQueryMoInstances(ctx context.Context, r soap.RoundTripper, req *DynamicTypeMgrQueryMoInstancesRequest) (*DynamicTypeMgrQueryMoInstancesResponse, error) { 62 var reqBody, resBody DynamicTypeMgrQueryMoInstancesBody 63 64 reqBody.Req = req 65 66 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 67 return nil, err 68 } 69 70 return resBody.Res, nil 71 } 72 73 type DynamicTypeMgrQueryTypeInfoBody struct { 74 Req *DynamicTypeMgrQueryTypeInfoRequest `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfo"` 75 Res *DynamicTypeMgrQueryTypeInfoResponse `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfoResponse"` 76 Fault_ *soap.Fault 77 } 78 79 func (b *DynamicTypeMgrQueryTypeInfoBody) Fault() *soap.Fault { return b.Fault_ } 80 81 func DynamicTypeMgrQueryTypeInfo(ctx context.Context, r soap.RoundTripper, req *DynamicTypeMgrQueryTypeInfoRequest) (*DynamicTypeMgrQueryTypeInfoResponse, error) { 82 var reqBody, resBody DynamicTypeMgrQueryTypeInfoBody 83 84 reqBody.Req = req 85 86 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 87 return nil, err 88 } 89 90 return resBody.Res, nil 91 } 92 93 type ExecuteSoapBody struct { 94 Req *ExecuteSoapRequest `xml:"urn:vim25 ExecuteSoap"` 95 Res *ExecuteSoapResponse `xml:"urn:vim25 ExecuteSoapResponse"` 96 Fault_ *soap.Fault 97 } 98 99 func (b *ExecuteSoapBody) Fault() *soap.Fault { return b.Fault_ } 100 101 func ExecuteSoap(ctx context.Context, r soap.RoundTripper, req *ExecuteSoapRequest) (*ExecuteSoapResponse, error) { 102 var reqBody, resBody ExecuteSoapBody 103 104 reqBody.Req = req 105 106 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 107 return nil, err 108 } 109 110 return resBody.Res, nil 111 } 112 113 type QueryVirtualDiskInfoTaskBody struct { 114 Req *QueryVirtualDiskInfoTaskRequest `xml:"urn:internalvim25 QueryVirtualDiskInfo_Task,omitempty"` 115 Res *QueryVirtualDiskInfo_TaskResponse `xml:"urn:vim25 QueryVirtualDiskInfo_TaskResponse,omitempty"` 116 InternalRes *QueryVirtualDiskInfo_TaskResponse `xml:"urn:internalvim25 QueryVirtualDiskInfo_TaskResponse,omitempty"` 117 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 118 } 119 120 func (b *QueryVirtualDiskInfoTaskBody) Fault() *soap.Fault { return b.Fault_ } 121 122 func QueryVirtualDiskInfoTask(ctx context.Context, r soap.RoundTripper, req *QueryVirtualDiskInfoTaskRequest) (*QueryVirtualDiskInfo_TaskResponse, error) { 123 var reqBody, resBody QueryVirtualDiskInfoTaskBody 124 125 reqBody.Req = req 126 127 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 128 return nil, err 129 } 130 131 if resBody.Res != nil { 132 return resBody.Res, nil 133 } 134 135 return resBody.InternalRes, nil 136 }