use crate::FluentRequest;
use serde::{Serialize, Deserialize};
use httpclient::InMemoryResponseExt;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LinkOauthCorrelationIdExchangeRequest {
pub link_correlation_id: String,
}
impl FluentRequest<'_, LinkOauthCorrelationIdExchangeRequest> {}
impl<'a> ::std::future::IntoFuture
for FluentRequest<'a, LinkOauthCorrelationIdExchangeRequest> {
type Output = httpclient::InMemoryResult<
crate::model::LinkOAuthCorrelationIdExchangeResponse,
>;
type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let url = "/link/oauth/correlation_id/exchange";
let mut r = self.client.client.post(url);
r = r
.json(
serde_json::json!(
{ "link_correlation_id" : self.params.link_correlation_id }
),
);
r = self.client.authenticate(r);
let res = r.await?;
res.json().map_err(Into::into)
})
}
}
impl crate::PlaidClient {
pub fn link_oauth_correlation_id_exchange(
&self,
link_correlation_id: &str,
) -> FluentRequest<'_, LinkOauthCorrelationIdExchangeRequest> {
FluentRequest {
client: self,
params: LinkOauthCorrelationIdExchangeRequest {
link_correlation_id: link_correlation_id.to_owned(),
},
}
}
}