use serde::Serialize;
#[derive(Default, Serialize)]
pub struct DSTListRequest {
year: Option<i32>,
country: Option<String>,
lang: Option<String>,
listplaces: Option<u8>,
onlydst: Option<u8>,
timechanges: Option<u8>,
verbosetime: Option<u8>,
}
impl DSTListRequest {
pub fn new() -> Self {
Default::default()
}
pub fn set_year(mut self, year: i32) -> Self {
self.year.insert(year);
self
}
pub fn set_country(mut self, country: impl Into<String>) -> Self {
self.country.insert(country.into());
self
}
pub fn set_lang(mut self, lang: impl Into<String>) -> Self {
self.lang.insert(lang.into());
self
}
pub fn set_listplaces(mut self, enable: bool) -> Self {
self.listplaces.insert(enable.into());
self
}
pub fn set_onlydst(mut self, enable: bool) -> Self {
self.onlydst.insert(enable.into());
self
}
pub fn set_timechanges(mut self, enable: bool) -> Self {
self.timechanges.insert(enable.into());
self
}
pub fn set_verbosetime(mut self, enable: bool) -> Self {
self.verbosetime.insert(enable.into());
self
}
}