#[derive(Clone, Debug, Default)]
pub struct ListItemsRequest {
pub since: Option<u64>,
pub limit: Option<u32>,
pub start: Option<u32>,
pub include_trash: bool,
pub collection_key: Option<String>,
pub item_type: Option<String>,
pub q: Option<String>,
}
impl ListItemsRequest {
pub fn to_query_pairs(&self) -> Vec<(String, String)> {
let mut pairs = Vec::new();
if let Some(value) = self.since {
pairs.push(("since".to_owned(), value.to_string()));
}
if let Some(value) = self.limit {
pairs.push(("limit".to_owned(), value.to_string()));
}
if let Some(value) = self.start {
pairs.push(("start".to_owned(), value.to_string()));
}
if self.include_trash {
pairs.push(("includeTrashed".to_owned(), "1".to_owned()));
}
if let Some(value) = &self.collection_key {
pairs.push(("collection".to_owned(), value.clone()));
}
if let Some(value) = &self.item_type {
pairs.push(("itemType".to_owned(), value.clone()));
}
if let Some(value) = &self.q {
pairs.push(("q".to_owned(), value.clone()));
}
pairs
}
}