stripe/request/
post_customers_customer.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 PostCustomersCustomerRequest {
12 pub customer: String,
13}
14impl PostCustomersCustomerRequest {}
15impl FluentRequest<'_, PostCustomersCustomerRequest> {}
16impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PostCustomersCustomerRequest> {
17 type Output = httpclient::InMemoryResult<Customer>;
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!(
22 "/v1/customers/{customer}", customer = self.params.customer
23 );
24 let mut r = self.client.client.post(url);
25 r = r.set_query(self.params);
26 r = self.client.authenticate(r);
27 let res = r.await?;
28 res.json().map_err(Into::into)
29 })
30 }
31}