/
billing_metereventsummary.go
54 lines (49 loc) · 2.24 KB
/
billing_metereventsummary.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
//
// File generated from our OpenAPI spec
//
//
package stripe
// Retrieve a list of billing meter event summaries.
type BillingMeterEventSummaryListParams struct {
ListParams `form:"*"`
ID *string `form:"-"` // Included in URL
// The customer for which to fetch event summaries.
Customer *string `form:"customer"`
// The timestamp from when to stop aggregating usage events (exclusive).
EndTime *int64 `form:"end_time"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// The timestamp from when to start aggregating usage events (inclusive).
StartTime *int64 `form:"start_time"`
// Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range.
ValueGroupingWindow *string `form:"value_grouping_window"`
}
// AddExpand appends a new field to expand.
func (p *BillingMeterEventSummaryListParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}
// A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
// usage was accrued by a customer for that period.
type BillingMeterEventSummary struct {
// Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via `default_aggregation``.
AggregatedValue float64 `json:"aggregated_value"`
// End timestamp for this usage summary (inclusive).
EndTime int64 `json:"end_time"`
// Unique identifier for the object.
ID string `json:"id"`
// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Livemode bool `json:"livemode"`
// The meter associated with this usage summary.
Meter string `json:"meter"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// Start timestamp for this usage summary (inclusive).
StartTime int64 `json:"start_time"`
}
// BillingMeterEventSummaryList is a list of MeterEventSummaries as retrieved from a list endpoint.
type BillingMeterEventSummaryList struct {
APIResource
ListMeta
Data []*BillingMeterEventSummary `json:"data"`
}