This is an automated email from the ASF dual-hosted git repository.

abh1sar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack-go.git


The following commit(s) were added to refs/heads/main by this push:
     new 2b126ae  fix: add importVm to detailsRequireZeroIndex and regenerate 
(#148)
2b126ae is described below

commit 2b126aea2151bcac4023467acfc22ce74da63b2d
Author: Gusmew <[email protected]>
AuthorDate: Wed Aug 5 17:51:35 2026 +0200

    fix: add importVm to detailsRequireZeroIndex and regenerate (#148)
    
    Co-authored-by: Francesco Gusmeroli <[email protected]>
---
 cloudstack/VirtualMachineService.go | 4 ++--
 generate/generate.go                | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cloudstack/VirtualMachineService.go 
b/cloudstack/VirtualMachineService.go
index 675b5c8..c4d7544 100644
--- a/cloudstack/VirtualMachineService.go
+++ b/cloudstack/VirtualMachineService.go
@@ -11516,8 +11516,8 @@ func (p *ImportVmParams) toURLValues() url.Values {
        }
        if v, found := p.p["details"]; found {
                m := v.(map[string]string)
-               for i, k := range getSortedKeysFromMap(m) {
-                       u.Set(fmt.Sprintf("details[%d].%s", i, k), m[k])
+               for _, k := range getSortedKeysFromMap(m) {
+                       u.Set(fmt.Sprintf("details[0].%s", k), m[k])
                }
        }
        if v, found := p.p["diskpath"]; found {
diff --git a/generate/generate.go b/generate/generate.go
index 7984f2b..52577e0 100644
--- a/generate/generate.go
+++ b/generate/generate.go
@@ -59,6 +59,7 @@ var detailsRequireZeroIndex = map[string]bool{
        "createAccount":        true,
        "updateAccount":        true,
        "updateVirtualMachine": true,
+       "importVm":             true,
 }
 
 // parametersRequireIndexing contains map parameters that always need

Reply via email to