plaid/request/
watchlist_screening_entity_get.rs

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