forked from stripe/stripe-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusage_record.go
27 lines (24 loc) · 900 Bytes
/
usage_record.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
package stripe
// Possible values for the action parameter on usage record creation.
const (
UsageRecordActionIncrement string = "increment"
UsageRecordActionSet string = "set"
)
// UsageRecord represents a usage record.
// See https://stripe.com/docs/api#usage_records
type UsageRecord struct {
ID string `json:"id"`
Live bool `json:"livemode"`
Quantity int64 `json:"quantity"`
SubscriptionItem string `json:"subscription_item"`
Timestamp int64 `json:"timestamp"`
}
// UsageRecordParams create a usage record for a specified subscription item
// and date, and fills it with a quantity.
type UsageRecordParams struct {
Params `form:"*"`
Action *string `form:"action"`
Quantity *int64 `form:"quantity"`
SubscriptionItem *string `form:"-"` // passed in the URL
Timestamp *int64 `form:"timestamp"`
}