plaid/request/
asset_report_audit_copy_get.rs

1use crate::FluentRequest;
2use serde::{Serialize, Deserialize};
3use httpclient::InMemoryResponseExt;
4/**You should use this struct via [`PlaidClient::asset_report_audit_copy_get`].
5
6On request success, this will return a [`AssetReportGetResponse`].*/
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct AssetReportAuditCopyGetRequest {
9    pub audit_copy_token: String,
10}
11impl FluentRequest<'_, AssetReportAuditCopyGetRequest> {}
12impl<'a> ::std::future::IntoFuture
13for FluentRequest<'a, AssetReportAuditCopyGetRequest> {
14    type Output = httpclient::InMemoryResult<crate::model::AssetReportGetResponse>;
15    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
16    fn into_future(self) -> Self::IntoFuture {
17        Box::pin(async move {
18            let url = "/asset_report/audit_copy/get";
19            let mut r = self.client.client.post(url);
20            r = r
21                .json(
22                    serde_json::json!(
23                        { "audit_copy_token" : self.params.audit_copy_token }
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    /**Retrieve an Asset Report Audit Copy
34
35`/asset_report/audit_copy/get` allows auditors to get a copy of an Asset Report that was previously shared via the `/asset_report/audit_copy/create` endpoint.  The caller of `/asset_report/audit_copy/create` must provide the `audit_copy_token` to the auditor.  This token can then be used to call `/asset_report/audit_copy/create`.
36
37See endpoint docs at <https://plaid.com/docs/none/>.*/
38    pub fn asset_report_audit_copy_get(
39        &self,
40        audit_copy_token: &str,
41    ) -> FluentRequest<'_, AssetReportAuditCopyGetRequest> {
42        FluentRequest {
43            client: self,
44            params: AssetReportAuditCopyGetRequest {
45                audit_copy_token: audit_copy_token.to_owned(),
46            },
47        }
48    }
49}