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