use crate::model::*;
use crate::JyveClient;
use serde_json::json;
#[derive(Clone)]
pub struct AccountPasswordCreateRequest<'a> {
pub(crate) http_client: &'a JyveClient,
pub data: PasswordRetype,
}
impl<'a> AccountPasswordCreateRequest<'a> {
pub async fn send(self) -> ::httpclient::InMemoryResult<PasswordRetype> {
let mut r = self.http_client.client.post("/account/password/");
r = r.json(json!({ "data" : self.data }));
r = self.http_client.authenticate(r);
let res = r.send_awaiting_body().await?;
res.json()
}
}
impl<'a> ::std::future::IntoFuture for AccountPasswordCreateRequest<'a> {
type Output = httpclient::InMemoryResult<PasswordRetype>;
type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
fn into_future(self) -> Self::IntoFuture {
Box::pin(self.send())
}
}