WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 9ee75c3

Browse files
authored
misc: Add total_aggregated_units (#297)
1 parent ac5bb24 commit 9ee75c3

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

customer.go

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,16 @@ type IntegrationCustomersResponse struct {
206206
}
207207

208208
type CustomerChargeUsage struct {
209-
Units string `json:"units,omitempty"`
210-
EventsCount int `json:"events_count"`
211-
AmountCents int `json:"amount_cents,omitempty"`
212-
AmountCurrency Currency `json:"amount_currency,omitempty"`
213-
Charge *Charge `json:"charge,omitempty"`
214-
BillableMetric *BillableMetric `json:"billable_metric,omitempty"`
215-
PricingUnitDetails *CustomerPricingUnitDetails `json:"pricing_unit_details,omitempty"`
216-
Filters []CustomerChargeFilterUsage `json:"filters,omitempty"`
217-
GroupedUsage []CustomerChargeGroupedUsage `json:"grouped_usage,omitempty"`
209+
TotalAggregatedUnits string `json:"total_aggregated_units,omitempty"`
210+
Units string `json:"units,omitempty"`
211+
EventsCount int `json:"events_count"`
212+
AmountCents int `json:"amount_cents,omitempty"`
213+
AmountCurrency Currency `json:"amount_currency,omitempty"`
214+
Charge *Charge `json:"charge,omitempty"`
215+
BillableMetric *BillableMetric `json:"billable_metric,omitempty"`
216+
PricingUnitDetails *CustomerPricingUnitDetails `json:"pricing_unit_details,omitempty"`
217+
Filters []CustomerChargeFilterUsage `json:"filters,omitempty"`
218+
GroupedUsage []CustomerChargeGroupedUsage `json:"grouped_usage,omitempty"`
218219
}
219220

220221
type CustomerProjectedChargeUsage struct {
@@ -238,12 +239,13 @@ type CustomerPricingUnitDetails struct {
238239
}
239240

240241
type CustomerChargeFilterUsage struct {
241-
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
242-
Values map[string]interface{} `json:"value,omitempty"`
243-
AmountCents int `json:"amount_cents,omitempty"`
244-
EventsCount int `json:"events_count,omitempty"`
245-
Units string `json:"units,omitempty"`
246-
PricingUnitDetails *CustomerPricingUnitDetails `json:"pricing_unit_details,omitempty"`
242+
TotalAggregatedUnits string `json:"total_aggregated_units,omitempty"`
243+
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
244+
Values map[string]interface{} `json:"value,omitempty"`
245+
AmountCents int `json:"amount_cents,omitempty"`
246+
EventsCount int `json:"events_count,omitempty"`
247+
Units string `json:"units,omitempty"`
248+
PricingUnitDetails *CustomerPricingUnitDetails `json:"pricing_unit_details,omitempty"`
247249
}
248250

249251
type CustomerProjectedChargeFilterUsage struct {
@@ -258,12 +260,13 @@ type CustomerProjectedChargeFilterUsage struct {
258260
}
259261

260262
type CustomerChargeGroupedUsage struct {
261-
AmountCents int `json:"amount_cents,omitempty"`
262-
EventsCount int `json:"events_count,omitempty"`
263-
Units string `json:"units,omitempty"`
264-
GroupedBy map[string]interface{} `json:"grouped_by,omitempty"`
265-
Filters []CustomerChargeFilterUsage `json:"filters,omitempty"`
266-
PricingUnitDetails *CustomerPricingUnitDetails `json:"pricing_unit_details,omitempty"`
263+
TotalAggregatedUnits string `json:"total_aggregated_units,omitempty"`
264+
AmountCents int `json:"amount_cents,omitempty"`
265+
EventsCount int `json:"events_count,omitempty"`
266+
Units string `json:"units,omitempty"`
267+
GroupedBy map[string]interface{} `json:"grouped_by,omitempty"`
268+
Filters []CustomerChargeFilterUsage `json:"filters,omitempty"`
269+
PricingUnitDetails *CustomerPricingUnitDetails `json:"pricing_unit_details,omitempty"`
267270
}
268271

269272
type CustomerProjectedChargeGroupedUsage struct {

fee.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ type Fee struct {
139139
ToDate string `json:"to_date,omitempty"`
140140
InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
141141

142-
Units string `json:"units,omitempty"`
143-
Description string `json:"description,omitempty"`
144-
EventsCount int `json:"events_count,omitempty"`
142+
TotalAggregatedUnits string `json:"total_aggregated_units,omitempty"`
143+
Units string `json:"units,omitempty"`
144+
Description string `json:"description,omitempty"`
145+
EventsCount int `json:"events_count,omitempty"`
145146

146147
PaymentStatus FeePaymentStatus `json:"payment_status,omitempty"`
147148

0 commit comments

Comments
 (0)