stripe/request/
post_topups_topup.rs1use serde_json::json;
2use crate::model::*;
3use crate::FluentRequest;
4use serde::{Serialize, Deserialize};
5use httpclient::InMemoryResponseExt;
6use crate::StripeClient;
7#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct PostTopupsTopupRequest {
12 pub topup: String,
13}
14impl PostTopupsTopupRequest {}
15impl FluentRequest<'_, PostTopupsTopupRequest> {}
16impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PostTopupsTopupRequest> {
17 type Output = httpclient::InMemoryResult<Topup>;
18 type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
19 fn into_future(self) -> Self::IntoFuture {
20 Box::pin(async move {
21 let url = &format!("/v1/topups/{topup}", topup = self.params.topup);
22 let mut r = self.client.client.post(url);
23 r = r.set_query(self.params);
24 r = self.client.authenticate(r);
25 let res = r.await?;
26 res.json().map_err(Into::into)
27 })
28 }
29}