use std::fmt::Display;
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct ListCustomerCustomAttributeDefinitionsParameters {
pub limit: Option<i32>,
pub cursor: Option<String>,
}
impl ListCustomerCustomAttributeDefinitionsParameters {
pub fn to_query_string(&self) -> String {
self.to_string()
}
}
impl From<ListCustomerCustomAttributeDefinitionsParameters> for String {
fn from(params: ListCustomerCustomAttributeDefinitionsParameters) -> Self {
params.to_string()
}
}
impl Display for ListCustomerCustomAttributeDefinitionsParameters {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut params = Vec::new();
if let Some(limit) = &self.limit {
params.push(format!("limit={}", limit));
}
if let Some(cursor) = &self.cursor {
params.push(format!("cursor={}", cursor));
}
let str = if params.is_empty() {
String::new()
} else {
format!("?{}", params.join("&"))
};
write!(f, "{}", str)
}
}