use crate::{Paging, Param, ParamError, ParamList};
#[derive(Debug)]
pub enum GetWhitelistsParam {
Limit(usize),
}
impl Param for GetWhitelistsParam {
fn try_as_tuple(&self) -> Result<(String, String), ParamError> {
Ok(match self {
Self::Limit(v) => ("limit".to_string(), v.to_string()),
})
}
}
#[derive(Debug)]
pub struct GetWhitelistsParamList {
pub values: Vec<GetWhitelistsParam>,
}
impl Default for GetWhitelistsParamList {
fn default() -> Self {
Self {
values: vec![],
}
}
}
impl ParamList for GetWhitelistsParamList {
type ParamType = GetWhitelistsParam;
fn add(mut self, param: Self::ParamType) -> Self {
self.values.push(param);
self
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct GetWhitelistsResponse {
pub items: Vec<WhitelistItem>,
pub paging: Paging,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WhitelistItem {
pub value: String,
pub reason: String,
pub r#type: String,
pub created_at: String,
}