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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
use chrono::{DateTime, Utc};
use serde::Deserialize;
#[derive(Deserialize, Debug, PartialEq, Eq, Hash, Clone)]
#[non_exhaustive]
pub struct Account {
pub id: String,
pub closed: bool,
pub created: DateTime<Utc>,
pub description: String,
#[serde(rename = "type")]
pub account_type: Type,
pub currency: String,
pub country_code: String,
pub owners: Vec<Owner>,
pub business_id: Option<String>,
pub account_number: String,
pub sort_code: String,
}
#[derive(Deserialize, Debug, PartialEq, Eq, Hash, Clone)]
pub struct Owner {
pub user_id: String,
pub preferred_name: String,
pub preferred_first_name: String,
}
#[allow(clippy::enum_variant_names)]
#[derive(Deserialize, Debug, PartialEq, Eq, Hash, Clone, Copy)]
#[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum Type {
UkRetail,
UkRetailJoint,
UkBusiness,
}
pub(crate) use list::Request as List;
mod list {
use crate::endpoints::Endpoint;
pub struct Request;
impl Endpoint for Request {
fn method(&self) -> reqwest::Method {
reqwest::Method::GET
}
fn endpoint(&self) -> &str {
"https://api.monzo.com/accounts"
}
}
}