plaid/request/
link_delivery_get.rs

1use crate::FluentRequest;
2use serde::{Serialize, Deserialize};
3use httpclient::InMemoryResponseExt;
4/**You should use this struct via [`PlaidClient::link_delivery_get`].
5
6On request success, this will return a [`LinkDeliveryGetResponse`].*/
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct LinkDeliveryGetRequest {
9    pub link_delivery_session_id: String,
10}
11impl FluentRequest<'_, LinkDeliveryGetRequest> {}
12impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LinkDeliveryGetRequest> {
13    type Output = httpclient::InMemoryResult<crate::model::LinkDeliveryGetResponse>;
14    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
15    fn into_future(self) -> Self::IntoFuture {
16        Box::pin(async move {
17            let url = "/link_delivery/get";
18            let mut r = self.client.client.post(url);
19            r = r
20                .json(
21                    serde_json::json!(
22                        { "link_delivery_session_id" : self.params
23                        .link_delivery_session_id }
24                    ),
25                );
26            r = self.client.authenticate(r);
27            let res = r.await?;
28            res.json().map_err(Into::into)
29        })
30    }
31}
32impl crate::PlaidClient {
33    /**Get Hosted Link session
34
35Use the `/link_delivery/get` endpoint to get the status of a Hosted Link session.
36
37See endpoint docs at <https://plaid.com/docs/assets/waitlist/hosted-link/>.*/
38    pub fn link_delivery_get(
39        &self,
40        link_delivery_session_id: &str,
41    ) -> FluentRequest<'_, LinkDeliveryGetRequest> {
42        FluentRequest {
43            client: self,
44            params: LinkDeliveryGetRequest {
45                link_delivery_session_id: link_delivery_session_id.to_owned(),
46            },
47        }
48    }
49}