github.com/vmware/govmomi@v0.37.1/lookup/methods/methods.go (about) 1 /* 2 Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package methods 18 19 import ( 20 "context" 21 22 "github.com/vmware/govmomi/lookup/types" 23 "github.com/vmware/govmomi/vim25/soap" 24 ) 25 26 type CreateBody struct { 27 Req *types.Create `xml:"urn:lookup Create,omitempty"` 28 Res *types.CreateResponse `xml:"urn:lookup CreateResponse,omitempty"` 29 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 30 } 31 32 func (b *CreateBody) Fault() *soap.Fault { return b.Fault_ } 33 34 func Create(ctx context.Context, r soap.RoundTripper, req *types.Create) (*types.CreateResponse, error) { 35 var reqBody, resBody CreateBody 36 37 reqBody.Req = req 38 39 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 40 return nil, err 41 } 42 43 return resBody.Res, nil 44 } 45 46 type DeleteBody struct { 47 Req *types.Delete `xml:"urn:lookup Delete,omitempty"` 48 Res *types.DeleteResponse `xml:"urn:lookup DeleteResponse,omitempty"` 49 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 50 } 51 52 func (b *DeleteBody) Fault() *soap.Fault { return b.Fault_ } 53 54 func Delete(ctx context.Context, r soap.RoundTripper, req *types.Delete) (*types.DeleteResponse, error) { 55 var reqBody, resBody DeleteBody 56 57 reqBody.Req = req 58 59 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 60 return nil, err 61 } 62 63 return resBody.Res, nil 64 } 65 66 type GetBody struct { 67 Req *types.Get `xml:"urn:lookup Get,omitempty"` 68 Res *types.GetResponse `xml:"urn:lookup GetResponse,omitempty"` 69 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 70 } 71 72 func (b *GetBody) Fault() *soap.Fault { return b.Fault_ } 73 74 func Get(ctx context.Context, r soap.RoundTripper, req *types.Get) (*types.GetResponse, error) { 75 var reqBody, resBody GetBody 76 77 reqBody.Req = req 78 79 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 80 return nil, err 81 } 82 83 return resBody.Res, nil 84 } 85 86 type GetLocaleBody struct { 87 Req *types.GetLocale `xml:"urn:lookup GetLocale,omitempty"` 88 Res *types.GetLocaleResponse `xml:"urn:lookup GetLocaleResponse,omitempty"` 89 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 90 } 91 92 func (b *GetLocaleBody) Fault() *soap.Fault { return b.Fault_ } 93 94 func GetLocale(ctx context.Context, r soap.RoundTripper, req *types.GetLocale) (*types.GetLocaleResponse, error) { 95 var reqBody, resBody GetLocaleBody 96 97 reqBody.Req = req 98 99 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 100 return nil, err 101 } 102 103 return resBody.Res, nil 104 } 105 106 type GetSiteIdBody struct { 107 Req *types.GetSiteId `xml:"urn:lookup GetSiteId,omitempty"` 108 Res *types.GetSiteIdResponse `xml:"urn:lookup GetSiteIdResponse,omitempty"` 109 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 110 } 111 112 func (b *GetSiteIdBody) Fault() *soap.Fault { return b.Fault_ } 113 114 func GetSiteId(ctx context.Context, r soap.RoundTripper, req *types.GetSiteId) (*types.GetSiteIdResponse, error) { 115 var reqBody, resBody GetSiteIdBody 116 117 reqBody.Req = req 118 119 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 120 return nil, err 121 } 122 123 return resBody.Res, nil 124 } 125 126 type ListBody struct { 127 Req *types.List `xml:"urn:lookup List,omitempty"` 128 Res *types.ListResponse `xml:"urn:lookup ListResponse,omitempty"` 129 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 130 } 131 132 func (b *ListBody) Fault() *soap.Fault { return b.Fault_ } 133 134 func List(ctx context.Context, r soap.RoundTripper, req *types.List) (*types.ListResponse, error) { 135 var reqBody, resBody ListBody 136 137 reqBody.Req = req 138 139 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 140 return nil, err 141 } 142 143 return resBody.Res, nil 144 } 145 146 type RetrieveHaBackupConfigurationBody struct { 147 Req *types.RetrieveHaBackupConfiguration `xml:"urn:lookup RetrieveHaBackupConfiguration,omitempty"` 148 Res *types.RetrieveHaBackupConfigurationResponse `xml:"urn:lookup RetrieveHaBackupConfigurationResponse,omitempty"` 149 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 150 } 151 152 func (b *RetrieveHaBackupConfigurationBody) Fault() *soap.Fault { return b.Fault_ } 153 154 func RetrieveHaBackupConfiguration(ctx context.Context, r soap.RoundTripper, req *types.RetrieveHaBackupConfiguration) (*types.RetrieveHaBackupConfigurationResponse, error) { 155 var reqBody, resBody RetrieveHaBackupConfigurationBody 156 157 reqBody.Req = req 158 159 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 160 return nil, err 161 } 162 163 return resBody.Res, nil 164 } 165 166 type RetrieveServiceContentBody struct { 167 Req *types.RetrieveServiceContent `xml:"urn:lookup RetrieveServiceContent,omitempty"` 168 Res *types.RetrieveServiceContentResponse `xml:"urn:lookup RetrieveServiceContentResponse,omitempty"` 169 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 170 } 171 172 func (b *RetrieveServiceContentBody) Fault() *soap.Fault { return b.Fault_ } 173 174 func RetrieveServiceContent(ctx context.Context, r soap.RoundTripper, req *types.RetrieveServiceContent) (*types.RetrieveServiceContentResponse, error) { 175 var reqBody, resBody RetrieveServiceContentBody 176 177 reqBody.Req = req 178 179 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 180 return nil, err 181 } 182 183 return resBody.Res, nil 184 } 185 186 type SetBody struct { 187 Req *types.Set `xml:"urn:lookup Set,omitempty"` 188 Res *types.SetResponse `xml:"urn:lookup SetResponse,omitempty"` 189 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 190 } 191 192 func (b *SetBody) Fault() *soap.Fault { return b.Fault_ } 193 194 func Set(ctx context.Context, r soap.RoundTripper, req *types.Set) (*types.SetResponse, error) { 195 var reqBody, resBody SetBody 196 197 reqBody.Req = req 198 199 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 200 return nil, err 201 } 202 203 return resBody.Res, nil 204 } 205 206 type SetLocaleBody struct { 207 Req *types.SetLocale `xml:"urn:lookup SetLocale,omitempty"` 208 Res *types.SetLocaleResponse `xml:"urn:lookup SetLocaleResponse,omitempty"` 209 Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` 210 } 211 212 func (b *SetLocaleBody) Fault() *soap.Fault { return b.Fault_ } 213 214 func SetLocale(ctx context.Context, r soap.RoundTripper, req *types.SetLocale) (*types.SetLocaleResponse, error) { 215 var reqBody, resBody SetLocaleBody 216 217 reqBody.Req = req 218 219 if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { 220 return nil, err 221 } 222 223 return resBody.Res, nil 224 }