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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// this file is @generated
use serde::{Deserialize, Serialize};
use super::customer_id::CustomerId;
/// A wallet's balance (credit that pays any charge of any of the customer's subscriptions, net of
/// unbilled usage) reached zero; credit included with a subscription may remain.
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[non_exhaustive]
pub struct WalletDepletedEventData {
/// The credit unit (its code) the amounts are in; absent for a currency.
#[serde(skip_serializing_if = "Option::is_none")]
pub credit_unit: Option<String>,
/// Decimal places of `credit_unit`: amounts are integers of 10^-precision credit.
#[serde(skip_serializing_if = "Option::is_none")]
pub credit_unit_precision: Option<i32>,
/// Absent when the amounts are in a credit unit.
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
pub customer_id: CustomerId,
/// Properties this version of the SDK does not know, sent back as received.
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}
impl WalletDepletedEventData {
/// Creates a value from its required fields.
#[must_use]
pub fn new(customer_id: impl Into<CustomerId>) -> Self {
Self {
credit_unit: None,
credit_unit_precision: None,
currency: None,
customer_id: customer_id.into(),
extra: serde_json::Map::new(),
}
}
}