up_api/v1/
standard.rs

1use serde::Deserialize;
2
3#[derive(Deserialize, Debug)]
4#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
5pub enum AccountTypeEnum {
6    Saver,
7    Transactional,
8}
9
10#[derive(Deserialize, Debug)]
11#[serde(rename_all = "camelCase")]
12pub struct MoneyObject {
13    /// The ISO 4217 currency code.
14    pub currency_code: String,
15    /// The amount of money, formatted as a string in the relevant currency.
16    /// For example, for an Australian dollar value of $10.56, this field will
17    /// be `"10.56"`. The currency symbol is not included in the string
18    pub value: String,
19    /// The amount of money in the smallest denomination for the currency, as a
20    /// 64-bit integer. For example, for an Australian dollar value of $10.56,
21    /// this field will be `1056`.
22    pub value_in_base_units: i64,
23}
24
25#[derive(Deserialize, Debug)]
26#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
27pub enum OwnershipTypeEnum {
28    Individual,
29    Joint,
30}
31
32#[derive(Deserialize, Debug)]
33#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
34pub enum TransactionStatusEnum {
35    Held,
36    Settled,
37}
38
39#[derive(Deserialize, Debug)]
40#[serde(rename_all = "camelCase")]
41pub struct HoldInfoObject {
42    /// The amount of this transaction while in the `HELD` status, in
43    /// Australian dollars.
44    pub amount: MoneyObject,
45    /// The foreign currency amount of this transaction while in the `HELD`
46    /// status. This field will be `null` for domestic transactions. The amount
47    /// was converted to the AUD amount reflected in the `amount` field.
48    pub foreign_amount: Option<MoneyObject>,
49}
50
51#[derive(Deserialize, Debug)]
52#[serde(rename_all = "camelCase")]
53pub struct RoundUpObject {
54    /// The total amount of this Round Up, including any boosts, represented as
55    /// a negative value.
56    pub amount: MoneyObject,
57    /// The portion of the Round Up `amount` owing to boosted Round Ups,
58    /// represented as a negative value. If no boost was added to the Round Up
59    /// this field will be `null`.
60    pub boost_portion: Option<MoneyObject>,
61}
62
63#[derive(Deserialize, Debug)]
64pub struct CashBackObject {
65    /// A brief description of why this cashback was paid.
66    pub description: String,
67    /// The total amount of cashback paid, represented as a positive value.
68    pub amount: MoneyObject,
69}
70
71#[derive(Deserialize, Debug)]
72#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
73pub enum CardPurchaseMethodEnum {
74    BarCode,
75    OCR,
76    CardPin,
77    CardDetails,
78    CardOnFile,
79    #[serde(rename = "ECOMMERCE")]
80    ECommerce,
81    MagneticStripe,
82    Contactless,
83}
84
85#[derive(Deserialize, Debug)]
86#[serde(rename_all = "camelCase")]
87pub struct CardPurchaseMethodObject {
88    /// The type of card purchase.
89    pub method: CardPurchaseMethodEnum,
90    /// The last four digits of the card used for the purchase, if applicable.
91    pub card_number_suffix: Option<String>,
92}
93
94
95#[derive(Deserialize, Debug)]
96#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
97pub enum WebhookEventTypeEnum {
98    TransactionCreated,
99    TransactionSettled,
100    TransactionDeleted,
101    Ping,
102}
103
104#[derive(Deserialize, Debug)]
105#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
106pub enum WebhookDeliveryStatusEnum {
107    Delivered,
108    Undeliverable,
109    BadResponseCode,
110}