public ManagedObjectReference CloneVApp_Task(string name, ManagedObjectReference target, VAppCloneSpec spec) { ManagedObjectReference result; try { VersionUtils.RequiresVersion(this.Client, VimVersion.Vim4); CloneVAppRequestType cloneVAppRequestType = new CloneVAppRequestType(); cloneVAppRequestType._this = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef); cloneVAppRequestType.name = name; cloneVAppRequestType.target = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(target); cloneVAppRequestType.spec = (VimApi_65.VAppCloneSpec)VIConvert.ToWsdlType(spec); result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.CloneVApp_Task(new CloneVApp_TaskRequest(cloneVAppRequestType)).CloneVApp_TaskResponse.returnval); } catch (FaultException ex) { throw FaultUtility.HandleFault(ex); } return(result); }
public ManagedObjectReference CloneVApp(string name, ManagedObjectReference target, VAppCloneSpec spec) { ManagedObjectReference result; try { VersionUtils.RequiresVersion(this.Client, VimVersion.Vim4); ManagedObjectReference taskReference = this.CloneVApp_Task(name, target, spec); result = (ManagedObjectReference)this.Client.WaitForTask(taskReference); } catch (FaultException ex) { throw FaultUtility.HandleFault(ex); } return(result); }