use crate::model::*;
use crate::JyveClient;
use serde_json::json;
#[derive(Clone)]
pub struct BrandNotesListRequest<'a> {
pub(crate) http_client: &'a JyveClient,
pub archived_at: Option<String>,
pub banners: Option<String>,
pub brand: Option<String>,
pub brand_public_id: Option<String>,
pub brands: Option<String>,
pub created_at: Option<String>,
pub deleted: Option<String>,
pub description: Option<String>,
pub id: Option<f64>,
pub is_archived: Option<String>,
pub job: Option<String>,
pub notes_in_context: Option<String>,
pub page: Option<i64>,
pub page_size: Option<i64>,
pub source: Option<String>,
pub started_at: Option<String>,
pub stores: Option<String>,
pub title: Option<String>,
pub updated_at: Option<String>,
}
impl<'a> BrandNotesListRequest<'a> {
pub async fn send(self) -> ::httpclient::InMemoryResult<Vec<BrandNoteInsights>> {
let mut r = self.http_client.client.get("/brand_notes/");
if let Some(ref unwrapped) = self.archived_at {
r = r.query("archived_at", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.banners {
r = r.query("banners", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.brand {
r = r.query("brand", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.brand_public_id {
r = r.query("brand__public_id", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.brands {
r = r.query("brands", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.created_at {
r = r.query("created_at", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.deleted {
r = r.query("deleted", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.description {
r = r.query("description", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.id {
r = r.query("id", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.is_archived {
r = r.query("is_archived", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.job {
r = r.query("job", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.notes_in_context {
r = r.query("notes_in_context", &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.source {
r = r.query("source", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.started_at {
r = r.query("started_at", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.stores {
r = r.query("stores", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.title {
r = r.query("title", &unwrapped.to_string());
}
if let Some(ref unwrapped) = self.updated_at {
r = r.query("updated_at", &unwrapped.to_string());
}
r = self.http_client.authenticate(r);
let res = r.send_awaiting_body().await?;
res.json()
}
pub fn archived_at(mut self, archived_at: &str) -> Self {
self.archived_at = Some(archived_at.to_owned());
self
}
pub fn banners(mut self, banners: &str) -> Self {
self.banners = Some(banners.to_owned());
self
}
pub fn brand(mut self, brand: &str) -> Self {
self.brand = Some(brand.to_owned());
self
}
pub fn brand_public_id(mut self, brand_public_id: &str) -> Self {
self.brand_public_id = Some(brand_public_id.to_owned());
self
}
pub fn brands(mut self, brands: &str) -> Self {
self.brands = Some(brands.to_owned());
self
}
pub fn created_at(mut self, created_at: &str) -> Self {
self.created_at = Some(created_at.to_owned());
self
}
pub fn deleted(mut self, deleted: &str) -> Self {
self.deleted = Some(deleted.to_owned());
self
}
pub fn description(mut self, description: &str) -> Self {
self.description = Some(description.to_owned());
self
}
pub fn id(mut self, id: f64) -> Self {
self.id = Some(id);
self
}
pub fn is_archived(mut self, is_archived: &str) -> Self {
self.is_archived = Some(is_archived.to_owned());
self
}
pub fn job(mut self, job: &str) -> Self {
self.job = Some(job.to_owned());
self
}
pub fn notes_in_context(mut self, notes_in_context: &str) -> Self {
self.notes_in_context = Some(notes_in_context.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 source(mut self, source: &str) -> Self {
self.source = Some(source.to_owned());
self
}
pub fn started_at(mut self, started_at: &str) -> Self {
self.started_at = Some(started_at.to_owned());
self
}
pub fn stores(mut self, stores: &str) -> Self {
self.stores = Some(stores.to_owned());
self
}
pub fn title(mut self, title: &str) -> Self {
self.title = Some(title.to_owned());
self
}
pub fn updated_at(mut self, updated_at: &str) -> Self {
self.updated_at = Some(updated_at.to_owned());
self
}
}
impl<'a> ::std::future::IntoFuture for BrandNotesListRequest<'a> {
type Output = httpclient::InMemoryResult<Vec<BrandNoteInsights>>;
type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
fn into_future(self) -> Self::IntoFuture {
Box::pin(self.send())
}
}