plaid/request/
sandbox_transfer_fire_webhook.rs

1use crate::FluentRequest;
2use serde::{Serialize, Deserialize};
3use httpclient::InMemoryResponseExt;
4/**You should use this struct via [`PlaidClient::sandbox_transfer_fire_webhook`].
5
6On request success, this will return a [`SandboxTransferFireWebhookResponse`].*/
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct SandboxTransferFireWebhookRequest {
9    pub webhook: String,
10}
11impl FluentRequest<'_, SandboxTransferFireWebhookRequest> {}
12impl<'a> ::std::future::IntoFuture
13for FluentRequest<'a, SandboxTransferFireWebhookRequest> {
14    type Output = httpclient::InMemoryResult<
15        crate::model::SandboxTransferFireWebhookResponse,
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 = "/sandbox/transfer/fire_webhook";
21            let mut r = self.client.client.post(url);
22            r = r.json(serde_json::json!({ "webhook" : self.params.webhook }));
23            r = self.client.authenticate(r);
24            let res = r.await?;
25            res.json().map_err(Into::into)
26        })
27    }
28}
29impl crate::PlaidClient {
30    /**Manually fire a Transfer webhook
31
32Use the `/sandbox/transfer/fire_webhook` endpoint to manually trigger a `TRANSFER_EVENTS_UPDATE` webhook in the Sandbox environment.
33
34See endpoint docs at <https://plaid.com/docs/api/sandbox/#sandboxtransferfire_webhook>.*/
35    pub fn sandbox_transfer_fire_webhook(
36        &self,
37        webhook: &str,
38    ) -> FluentRequest<'_, SandboxTransferFireWebhookRequest> {
39        FluentRequest {
40            client: self,
41            params: SandboxTransferFireWebhookRequest {
42                webhook: webhook.to_owned(),
43            },
44        }
45    }
46}