use std::fmt::Display;
#[derive(Clone, Debug, Default)]
pub struct ListLocationBookingProfilesParameters {
pub limit: Option<i32>,
pub cursor: Option<String>,
}
impl ListLocationBookingProfilesParameters {
pub fn to_query_string(&self) -> String {
self.to_string()
}
}
impl From<ListLocationBookingProfilesParameters> for String {
fn from(
list_location_booking_profiles_parameters: ListLocationBookingProfilesParameters,
) -> Self {
list_location_booking_profiles_parameters.to_string()
}
}
impl Display for ListLocationBookingProfilesParameters {
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)
}
}