| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._stripe_object import StripeObject |
| 4 |
from typing import ClassVar, Dict |
| 5 |
from typing_extensions import Literal |
| 6 |
|
| 7 |
|
| 8 |
class MeterEvent(StripeObject): |
| 9 |
""" |
| 10 |
A Meter Event is a usage record that captures billable activity for usage-based billing. Meter Events contain an event name, timestamp, and payload with customer mapping and usage value, enabling accurate usage tracking and billing. |
| 11 |
""" |
| 12 |
|
| 13 |
OBJECT_NAME: ClassVar[Literal["v2.billing.meter_event"]] = ( |
| 14 |
"v2.billing.meter_event" |
| 15 |
) |
| 16 |
created: str |
| 17 |
""" |
| 18 |
The creation time of this meter event. |
| 19 |
""" |
| 20 |
event_name: str |
| 21 |
""" |
| 22 |
The name of the meter event. Corresponds with the `event_name` field on a meter. |
| 23 |
""" |
| 24 |
identifier: str |
| 25 |
""" |
| 26 |
A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. |
| 27 |
""" |
| 28 |
livemode: bool |
| 29 |
""" |
| 30 |
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. |
| 31 |
""" |
| 32 |
object: Literal["v2.billing.meter_event"] |
| 33 |
""" |
| 34 |
String representing the object's type. Objects of the same type share the same value of the object field. |
| 35 |
""" |
| 36 |
payload: Dict[str, str] |
| 37 |
""" |
| 38 |
The payload of the event. This must contain the fields corresponding to a meter's |
| 39 |
`customer_mapping.event_payload_key` (default is `stripe_customer_id`) and |
| 40 |
`value_settings.event_payload_key` (default is `value`). Read more about |
| 41 |
the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides).. |
| 42 |
""" |
| 43 |
timestamp: str |
| 44 |
""" |
| 45 |
The time of the event. Must be within the past 35 calendar days or up to |
| 46 |
5 minutes in the future. Defaults to current timestamp if not specified. |
| 47 |
""" |