plaid 9.0.1

Plaid client, generated from the OpenAPI spec.
Documentation
use crate::FluentRequest;
use serde::{Serialize, Deserialize};
use httpclient::InMemoryResponseExt;
use crate::model::{TransactionsEnrichRequestOptions, ClientProvidedTransaction};
/**You should use this struct via [`PlaidClient::transactions_enrich`].

On request success, this will return a [`TransactionsEnrichResponse`].*/
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TransactionsEnrichRequest {
    pub account_type: String,
    pub options: Option<TransactionsEnrichRequestOptions>,
    pub transactions: Vec<ClientProvidedTransaction>,
}
impl FluentRequest<'_, TransactionsEnrichRequest> {
    ///Set the value of the options field.
    pub fn options(mut self, options: TransactionsEnrichRequestOptions) -> Self {
        self.params.options = Some(options);
        self
    }
}
impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsEnrichRequest> {
    type Output = httpclient::InMemoryResult<crate::model::TransactionsEnrichResponse>;
    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
    fn into_future(self) -> Self::IntoFuture {
        Box::pin(async move {
            let url = "/transactions/enrich";
            let mut r = self.client.client.post(url);
            r = r.json(serde_json::json!({ "account_type" : self.params.account_type }));
            if let Some(ref unwrapped) = self.params.options {
                r = r.json(serde_json::json!({ "options" : unwrapped }));
            }
            r = r.json(serde_json::json!({ "transactions" : self.params.transactions }));
            r = self.client.authenticate(r);
            let res = r.await?;
            res.json().map_err(Into::into)
        })
    }
}
impl crate::PlaidClient {
    /**Enrich locally-held transaction data

The `/transactions/enrich` endpoint enriches raw transaction data generated by your own banking products or retrieved from other non-Plaid sources.

See endpoint docs at <https://plaid.com/docs/api/products/enrich/#transactionsenrich>.*/
    pub fn transactions_enrich(
        &self,
        account_type: &str,
        transactions: Vec<ClientProvidedTransaction>,
    ) -> FluentRequest<'_, TransactionsEnrichRequest> {
        FluentRequest {
            client: self,
            params: TransactionsEnrichRequest {
                account_type: account_type.to_owned(),
                options: None,
                transactions,
            },
        }
    }
}