use std::fmt::Display;
#[derive(Clone, Debug, Default)]
pub struct DeleteInvoiceParameters {
pub version: Option<i32>,
}
impl DeleteInvoiceParameters {
pub fn to_query_string(&self) -> String {
self.to_string()
}
}
impl From<DeleteInvoiceParameters> for String {
fn from(delete_invoice_parameters: DeleteInvoiceParameters) -> Self {
delete_invoice_parameters.to_string()
}
}
impl Display for DeleteInvoiceParameters {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut params = Vec::new();
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)
}
}