github.com/vmware/govmomi@v0.37.2/simulator/internal/types.go (about)

     1  /*
     2  Copyright (c) 2014-2022 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 internal
    18  
    19  import (
    20  	"reflect"
    21  
    22  	"github.com/vmware/govmomi/vim25/soap"
    23  	"github.com/vmware/govmomi/vim25/types"
    24  )
    25  
    26  // Minimal set of internal types and methods:
    27  // - Fetch() - used by ovftool to collect various managed object properties
    28  // - RetrieveInternalContent() - used by ovftool to obtain a reference to NfcService (which it does not use by default)
    29  
    30  func init() {
    31  	types.Add("Fetch", reflect.TypeOf((*Fetch)(nil)).Elem())
    32  }
    33  
    34  type Fetch struct {
    35  	This types.ManagedObjectReference `xml:"_this"`
    36  	Prop string                       `xml:"prop"`
    37  }
    38  
    39  type FetchResponse struct {
    40  	Returnval types.AnyType `xml:"returnval,omitempty,typeattr"`
    41  }
    42  
    43  type FetchBody struct {
    44  	Req    *Fetch         `xml:"Fetch,omitempty"`
    45  	Res    *FetchResponse `xml:"FetchResponse,omitempty"`
    46  	Fault_ *soap.Fault    `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"`
    47  }
    48  
    49  func (b *FetchBody) Fault() *soap.Fault { return b.Fault_ }
    50  
    51  func init() {
    52  	types.Add("RetrieveInternalContent", reflect.TypeOf((*RetrieveInternalContent)(nil)).Elem())
    53  }
    54  
    55  type RetrieveInternalContent struct {
    56  	This types.ManagedObjectReference `xml:"_this"`
    57  }
    58  
    59  type RetrieveInternalContentResponse struct {
    60  	Returnval InternalServiceInstanceContent `xml:"returnval"`
    61  }
    62  
    63  type RetrieveInternalContentBody struct {
    64  	Res    *RetrieveInternalContentResponse `xml:"RetrieveInternalContentResponse,omitempty"`
    65  	Fault_ *soap.Fault                      `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"`
    66  }
    67  
    68  func (b *RetrieveInternalContentBody) Fault() *soap.Fault { return b.Fault_ }
    69  
    70  type InternalServiceInstanceContent struct {
    71  	types.DynamicData
    72  
    73  	NfcService types.ManagedObjectReference `xml:"nfcService"`
    74  }