Skip to content

Commit

Permalink
Merge pull request #4 from sbrueseke/fix_console_endpoint_wrapper
Browse files Browse the repository at this point in the history
add wrapper object
  • Loading branch information
sbrueseke authored Feb 26, 2024
2 parents d35ff05 + e94fc6d commit 5244813
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cloudstack/ConsoleEndpointService.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ func (s *ConsoleEndpointService) CreateConsoleEndpoint(p *CreateConsoleEndpointP
return nil, err
}

var r CreateConsoleEndpointResponse
if err := json.Unmarshal(resp, &r); err != nil {
var nested struct {
Response CreateConsoleEndpointResponse `json:"consoleendpoint"`
}
if err := json.Unmarshal(resp, &nested); err != nil {
return nil, err
}
r := nested.Response

return &r, nil
}
Expand Down
1 change: 1 addition & 0 deletions generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ var nestedResponse = map[string]string{
"getCloudIdentifier": "cloudidentifier",
"getKubernetesClusterConfig": "clusterconfig",
"getPathForVolume": "apipathforvolume",
"createConsoleEndpoint": "consoleendpoint",
}

// longToStringConvertedParams is a prefilled map with the list of
Expand Down

0 comments on commit 5244813

Please sign in to comment.