This is an automated email from the ASF dual-hosted git repository. dahn pushed a commit to branch pr90 in repository https://gitbox.apache.org/repos/asf/cloudstack-go.git
commit 00d10c3d9bb8a781bd05ebd50e2c21f72d1ac5dd Author: tonymmm1 <[email protected]> AuthorDate: Sat Jul 27 11:28:17 2024 -0500 fix quotaTariffList --- cloudstack/QuotaService.go | 5 +++++ generate/generate.go | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cloudstack/QuotaService.go b/cloudstack/QuotaService.go index 287905b..8d7a7dc 100644 --- a/cloudstack/QuotaService.go +++ b/cloudstack/QuotaService.go @@ -1380,6 +1380,11 @@ func (s *QuotaService) QuotaTariffList(p *QuotaTariffListParams) (*QuotaTariffLi } type QuotaTariffListResponse struct { + Count int `json:"count"` + QuotaTariffList []*QuotaTariffList `json:"quotatariff"` +} + +type QuotaTariffList struct { ActivationRule string `json:"activationRule"` Currency string `json:"currency"` Description string `json:"description"` diff --git a/generate/generate.go b/generate/generate.go index 74807f1..4ae2ff9 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -1905,7 +1905,8 @@ func (s *service) generateResponseType(a *API) { // If this is a 'list' response, we need an separate list struct. There seem to be other // types of responses that also need a separate list struct, so checking on exact matches // for those once. - if strings.HasPrefix(a.Name, "list") || a.Name == "registerTemplate" || a.Name == "findHostsForMigration" || a.Name == "registerUserData" || a.Name == "quotaSummary" { + if strings.HasPrefix(a.Name, "list") || a.Name == "registerTemplate" || a.Name == "findHostsForMigration" || a.Name == "registerUserData" || + a.Name == "quotaSummary" || a.Name == "quotaTariffList" { pn("type %s struct {", tn) // This nasty check is for some specific response that do not behave consistent @@ -1981,6 +1982,9 @@ func (s *service) generateResponseType(a *API) { case "listStoragePoolsMetrics": pn(" Count int `json:\"count\"`") pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "storagepool") + case "quotaTariffList": + pn(" Count int `json:\"count\"`") + pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "quotatariff") case "quotaSummary": pn(" Count int `json:\"count\"`") pn(" %s []*%s `json:\"%s\"`", ln, parseSingular(ln), "summary")
