plaid/request/
wallet_transaction_list.rs1use crate::FluentRequest;
2use serde::{Serialize, Deserialize};
3use httpclient::InMemoryResponseExt;
4use crate::model::WalletTransactionListRequestOptions;
5#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct WalletTransactionListRequest {
10 pub count: Option<i64>,
11 pub cursor: Option<String>,
12 pub options: Option<WalletTransactionListRequestOptions>,
13 pub wallet_id: String,
14}
15impl FluentRequest<'_, WalletTransactionListRequest> {
16 pub fn count(mut self, count: i64) -> Self {
18 self.params.count = Some(count);
19 self
20 }
21 pub fn cursor(mut self, cursor: &str) -> Self {
23 self.params.cursor = Some(cursor.to_owned());
24 self
25 }
26 pub fn options(mut self, options: WalletTransactionListRequestOptions) -> Self {
28 self.params.options = Some(options);
29 self
30 }
31}
32impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WalletTransactionListRequest> {
33 type Output = httpclient::InMemoryResult<
34 crate::model::WalletTransactionListResponse,
35 >;
36 type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
37 fn into_future(self) -> Self::IntoFuture {
38 Box::pin(async move {
39 let url = "/wallet/transaction/list";
40 let mut r = self.client.client.post(url);
41 if let Some(ref unwrapped) = self.params.count {
42 r = r.json(serde_json::json!({ "count" : unwrapped }));
43 }
44 if let Some(ref unwrapped) = self.params.cursor {
45 r = r.json(serde_json::json!({ "cursor" : unwrapped }));
46 }
47 if let Some(ref unwrapped) = self.params.options {
48 r = r.json(serde_json::json!({ "options" : unwrapped }));
49 }
50 r = r.json(serde_json::json!({ "wallet_id" : self.params.wallet_id }));
51 r = self.client.authenticate(r);
52 let res = r.await?;
53 res.json().map_err(Into::into)
54 })
55 }
56}
57impl crate::PlaidClient {
58 pub fn wallet_transaction_list(
64 &self,
65 wallet_id: &str,
66 ) -> FluentRequest<'_, WalletTransactionListRequest> {
67 FluentRequest {
68 client: self,
69 params: WalletTransactionListRequest {
70 count: None,
71 cursor: None,
72 options: None,
73 wallet_id: wallet_id.to_owned(),
74 },
75 }
76 }
77}