methods.go 7.0 KB

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