1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::resources::{Address, List};
use chrono::{DateTime, Utc};
use crate::client::Client;

#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[serde(rename_all="camelCase")]
pub struct Statement {
    pub account_number: String,
    pub company_legal_address: Address,
    pub company_legal_name: String,
    pub ein: String,
    pub end_date: DateTime<Utc>,
    pub ending_balance: f32,
    pub routing_number: Option<String>,
    pub start_date: DateTime<Utc>
}

impl Statement {

    pub async fn list(client: &Client, id: &str) -> crate::Result<List<Self>> {
        client.get("/account", vec![id, "statements"], serde_json::Map::new()).await
    }

}