stripe/resources/generated/
usage_record_summary.rs

1// ======================================
2// This file was automatically generated.
3// ======================================
4
5use crate::ids::UsageRecordSummaryId;
6use crate::params::{Object, Timestamp};
7use serde::{Deserialize, Serialize};
8
9/// The resource representing a Stripe "UsageRecordSummary".
10#[derive(Clone, Debug, Default, Deserialize, Serialize)]
11pub struct UsageRecordSummary {
12    /// Unique identifier for the object.
13    pub id: UsageRecordSummaryId,
14
15    /// The invoice in which this usage period has been billed for.
16    pub invoice: Option<String>,
17
18    /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
19    pub livemode: bool,
20
21    pub period: Period,
22
23    /// The ID of the subscription item this summary is describing.
24    pub subscription_item: String,
25
26    /// The total usage within this usage period.
27    pub total_usage: i64,
28}
29
30impl Object for UsageRecordSummary {
31    type Id = UsageRecordSummaryId;
32    fn id(&self) -> Self::Id {
33        self.id.clone()
34    }
35    fn object(&self) -> &'static str {
36        "usage_record_summary"
37    }
38}
39
40#[derive(Clone, Debug, Default, Deserialize, Serialize)]
41pub struct Period {
42    /// The end date of this usage period.
43    ///
44    /// All usage up to and including this point in time is included.
45    pub end: Option<Timestamp>,
46
47    /// The start date of this usage period.
48    ///
49    /// All usage after this point in time is included.
50    pub start: Option<Timestamp>,
51}