github.com/stripe/stripe-go/v76@v76.25.0/billing_metereventsummary.go (about)

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