github.com/stripe/stripe-go/v76@v76.25.0/usagerecordsummary.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). 10 // 11 // The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. 12 type UsageRecordSummaryListParams struct { 13 ListParams `form:"*"` 14 SubscriptionItem *string `form:"-"` // Included in URL 15 // Specifies which fields in the response should be expanded. 16 Expand []*string `form:"expand"` 17 } 18 19 // AddExpand appends a new field to expand. 20 func (p *UsageRecordSummaryListParams) AddExpand(f string) { 21 p.Expand = append(p.Expand, &f) 22 } 23 24 type UsageRecordSummary struct { 25 // Unique identifier for the object. 26 ID string `json:"id"` 27 // The invoice in which this usage period has been billed for. 28 Invoice string `json:"invoice"` 29 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 30 Livemode bool `json:"livemode"` 31 // String representing the object's type. Objects of the same type share the same value. 32 Object string `json:"object"` 33 Period *Period `json:"period"` 34 // The ID of the subscription item this summary is describing. 35 SubscriptionItem string `json:"subscription_item"` 36 // The total usage within this usage period. 37 TotalUsage int64 `json:"total_usage"` 38 } 39 40 // UsageRecordSummaryList is a list of UsageRecordSummaries as retrieved from a list endpoint. 41 type UsageRecordSummaryList struct { 42 APIResource 43 ListMeta 44 Data []*UsageRecordSummary `json:"data"` 45 }