Skip to content

Commit eff265b

Browse files
authored
feat(Usage Reports): Update Account Summary (#261)
Signed-off-by: Jonathan Date-chong <jtdatechong@gmail.com>
1 parent c940e94 commit eff265b

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

usagereportsv4/usage_reports_v4.go

+20
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ type AccountSummary struct {
704704
// The ID of the account.
705705
AccountID *string `json:"account_id" validate:"required"`
706706

707+
// The list of account resources for the month.
708+
AccountResources []Resource `json:"account_resources,omitempty"`
709+
707710
// The month in which usages were incurred. Represented in yyyy-mm format.
708711
Month *string `json:"month" validate:"required"`
709712

@@ -722,6 +725,9 @@ type AccountSummary struct {
722725
// Support-related charges.
723726
Support []SupportSummary `json:"support" validate:"required"`
724727

728+
// The list of support resources for the month.
729+
SupportResources []interface{} `json:"support_resources,omitempty"`
730+
725731
// A summary of charges and credits related to a subscription.
726732
Subscription *SubscriptionSummary `json:"subscription" validate:"required"`
727733
}
@@ -733,6 +739,10 @@ func UnmarshalAccountSummary(m map[string]json.RawMessage, result interface{}) (
733739
if err != nil {
734740
return
735741
}
742+
err = core.UnmarshalModel(m, "account_resources", &obj.AccountResources, UnmarshalResource)
743+
if err != nil {
744+
return
745+
}
736746
err = core.UnmarshalPrimitive(m, "month", &obj.Month)
737747
if err != nil {
738748
return
@@ -757,6 +767,10 @@ func UnmarshalAccountSummary(m map[string]json.RawMessage, result interface{}) (
757767
if err != nil {
758768
return
759769
}
770+
err = core.UnmarshalPrimitive(m, "support_resources", &obj.SupportResources)
771+
if err != nil {
772+
return
773+
}
760774
err = core.UnmarshalModel(m, "subscription", &obj.Subscription, UnmarshalSubscriptionSummary)
761775
if err != nil {
762776
return
@@ -1965,6 +1979,8 @@ type Plan struct {
19651979
// The pricing region for the plan.
19661980
PricingRegion *string `json:"pricing_region,omitempty"`
19671981

1982+
PricingPlanID *string `json:"pricing_plan_id,omitempty"`
1983+
19681984
// Indicates if the plan charges are billed to the customer.
19691985
Billable *bool `json:"billable" validate:"required"`
19701986

@@ -1999,6 +2015,10 @@ func UnmarshalPlan(m map[string]json.RawMessage, result interface{}) (err error)
19992015
if err != nil {
20002016
return
20012017
}
2018+
err = core.UnmarshalPrimitive(m, "pricing_plan_id", &obj.PricingPlanID)
2019+
if err != nil {
2020+
return
2021+
}
20022022
err = core.UnmarshalPrimitive(m, "billable", &obj.Billable)
20032023
if err != nil {
20042024
return

0 commit comments

Comments
 (0)