From a8c6d127abf93fed043f0d68ce08d155f0a51720 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Wed, 6 Nov 2019 20:16:37 +0100 Subject: [PATCH] Unwrap the GetVirtualMachineUserData response --- cloudstack/UserService.go | 4 ++++ generate/generate.go | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cloudstack/UserService.go b/cloudstack/UserService.go index cf121e6..9a6629c 100644 --- a/cloudstack/UserService.go +++ b/cloudstack/UserService.go @@ -553,6 +553,10 @@ func (s *UserService) GetVirtualMachineUserData(p *GetVirtualMachineUserDataPara return nil, err } + if resp, err = getRawValue(resp); err != nil { + return nil, err + } + var r GetVirtualMachineUserDataResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err diff --git a/generate/generate.go b/generate/generate.go index d41e397..d2c2baf 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -1220,7 +1220,17 @@ func (s *service) generateNewAPICallFunc(a *API) { pn(" }") pn("") switch n { - case "CreateAccount", "CreateUser", "RegisterUserKeys", "CreateNetwork", "CreateNetworkOffering", "CreateSecurityGroup", "CreateServiceOffering", "CreateSSHKeyPair", "RegisterSSHKeyPair": + case + "CreateAccount", + "CreateNetwork", + "CreateNetworkOffering", + "CreateSSHKeyPair", + "CreateSecurityGroup", + "CreateServiceOffering", + "CreateUser", + "GetVirtualMachineUserData", + "RegisterSSHKeyPair", + "RegisterUserKeys": pn(" if resp, err = getRawValue(resp); err != nil {") pn(" return nil, err") pn(" }")