Skip to content

Commit

Permalink
fix(Usage Reports): regen usage reports with latest API def (#245)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Date-chong <[email protected]>
  • Loading branch information
Jdatechong authored Apr 5, 2023
1 parent 0b1f2e9 commit 0e1ddc8
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 22 deletions.
46 changes: 44 additions & 2 deletions usagereportsv4/usage_reports_v4.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.62.0-a2a22f95-20221115-162524
* IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647
*/

// Package usagereportsv4 : Operations and models for the UsageReportsV4 service
Expand Down Expand Up @@ -781,6 +781,9 @@ type AccountUsage struct {

// All the resource used in the account.
Resources []Resource `json:"resources" validate:"required"`

// The value of the account's currency in USD.
CurrencyRate *float64 `json:"currency_rate,omitempty"`
}

// UnmarshalAccountUsage unmarshals an instance of AccountUsage from the specified map of raw messages.
Expand All @@ -806,6 +809,10 @@ func UnmarshalAccountUsage(m map[string]json.RawMessage, result interface{}) (er
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "currency_rate", &obj.CurrencyRate)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down Expand Up @@ -1506,6 +1513,12 @@ type InstanceUsage struct {

// All the resource used in the account.
Usage []Metric `json:"usage" validate:"required"`

// Pending charge from classic infrastructure.
Pending *bool `json:"pending,omitempty"`

// The value of the account's currency in USD.
CurrencyRate *float64 `json:"currency_rate,omitempty"`
}

// UnmarshalInstanceUsage unmarshals an instance of InstanceUsage from the specified map of raw messages.
Expand Down Expand Up @@ -1595,6 +1608,14 @@ func UnmarshalInstanceUsage(m map[string]json.RawMessage, result interface{}) (e
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "pending", &obj.Pending)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "currency_rate", &obj.CurrencyRate)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down Expand Up @@ -1889,6 +1910,9 @@ type OrgUsage struct {

// All the resource used in the account.
Resources []Resource `json:"resources" validate:"required"`

// The value of the account's currency in USD.
CurrencyRate *float64 `json:"currency_rate,omitempty"`
}

// UnmarshalOrgUsage unmarshals an instance of OrgUsage from the specified map of raw messages.
Expand Down Expand Up @@ -1922,6 +1946,10 @@ func UnmarshalOrgUsage(m map[string]json.RawMessage, result interface{}) (err er
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "currency_rate", &obj.CurrencyRate)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down Expand Up @@ -1951,6 +1979,9 @@ type Plan struct {

// All the discounts applicable to the plan.
Discounts []Discount `json:"discounts" validate:"required"`

// Pending charge from classic infrastructure.
Pending *bool `json:"pending,omitempty"`
}

// UnmarshalPlan unmarshals an instance of Plan from the specified map of raw messages.
Expand Down Expand Up @@ -1988,6 +2019,10 @@ func UnmarshalPlan(m map[string]json.RawMessage, result interface{}) (err error)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "pending", &obj.Pending)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down Expand Up @@ -2080,6 +2115,9 @@ type ResourceGroupUsage struct {

// All the resource used in the account.
Resources []Resource `json:"resources" validate:"required"`

// The value of the account's currency in USD.
CurrencyRate *float64 `json:"currency_rate,omitempty"`
}

// UnmarshalResourceGroupUsage unmarshals an instance of ResourceGroupUsage from the specified map of raw messages.
Expand Down Expand Up @@ -2113,6 +2151,10 @@ func UnmarshalResourceGroupUsage(m map[string]json.RawMessage, result interface{
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "currency_rate", &obj.CurrencyRate)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down
2 changes: 1 addition & 1 deletion usagereportsv4/usage_reports_v4_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 0e1ddc8

Please sign in to comment.