use crate::model::*;
use crate::JyveClient;
use serde_json::json;
#[derive(Clone)]
pub struct CredentialsListFulfilledRequest<'a> {
pub(crate) http_client: &'a JyveClient,
pub archived_at_isnull: Option<String>,
pub ids: Option<String>,
pub page: Option<i64>,
pub page_size: Option<i64>,
pub types: Option<String>,
pub updated_at: Option<String>,
pub updated_at_gte: Option<String>,
}
impl<'a> CredentialsListFulfilledRequest<'a> {
pub async fn send(self) -> ::httpclient::InMemoryResult<serde_json::Value> {
let mut r = self.http_client.client.get("/credentials/fulfilled/");
if let Some(ref unwrapped) = self.archived_at_isnull {
r = r.query("archived_at__isnull", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.ids {
r = r.query("ids", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.page {
r = r.query("page", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.page_size {
r = r.query("page_size", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.types {
r = r.query("types", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.updated_at {
r = r.query("updated_at", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.updated_at_gte {
r = r.query("updated_at__gte", &unwrapped.to_string());
}
r = self.http_client.authenticate(r);
let res = r.send_awaiting_body().await?;
res.json()
}
pub fn archived_at_isnull(mut self, archived_at_isnull: &str) -> Self {
self.archived_at_isnull = Some(archived_at_isnull.to_owned());
self
}
pub fn ids(mut self, ids: &str) -> Self {
self.ids = Some(ids.to_owned());
self
}
pub fn page(mut self, page: i64) -> Self {
self.page = Some(page);
self
}
pub fn page_size(mut self, page_size: i64) -> Self {
self.page_size = Some(page_size);
self
}
pub fn types(mut self, types: &str) -> Self {
self.types = Some(types.to_owned());
self
}
pub fn updated_at(mut self, updated_at: &str) -> Self {
self.updated_at = Some(updated_at.to_owned());
self
}
pub fn updated_at_gte(mut self, updated_at_gte: &str) -> Self {
self.updated_at_gte = Some(updated_at_gte.to_owned());
self
}
}
impl<'a> ::std::future::IntoFuture for CredentialsListFulfilledRequest<'a> {
type Output = httpclient::InMemoryResult<serde_json::Value>;
type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
fn into_future(self) -> Self::IntoFuture {
Box::pin(self.send())
}
}