use crate::model::*;
use crate::FluentRequest;
use serde::{Serialize, Deserialize};
use httpclient::InMemoryResponseExt;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GetPracticesRequest {
pub group_id: Option<i64>,
}
impl FluentRequest<'_, GetPracticesRequest> {
pub fn group_id(mut self, group_id: i64) -> Self {
self.params.group_id = Some(group_id);
self
}
}
impl<'a> ::std::future::IntoFuture for FluentRequest<'a, GetPracticesRequest> {
type Output = httpclient::InMemoryResult<PracticeListServiceResponse>;
type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let url = "/api/practices";
let mut r = self.client.client.get(url);
r = r.set_query(self.params);
let res = r.await?;
res.json().map_err(Into::into)
})
}
}