#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CustomTimestamp {
#[builder(into)]
#[serde(rename = "format")]
format: String,
#[builder(default, into)]
#[serde(rename = "defaultYear", skip_serializing_if = "Option::is_none", default)]
default_year: Option<i32>,
#[builder(default, into)]
#[serde(
rename = "defaultDayOfYear",
skip_serializing_if = "Option::is_none",
default
)]
default_day_of_year: Option<i32>,
}
impl CustomTimestamp {
#[inline]
pub fn new(format: impl Into<String>) -> Self {
Self::builder().format(format).build()
}
#[inline]
pub fn format(&self) -> &str {
&*self.format
}
#[inline]
pub fn default_year(&self) -> Option<i32> {
self.default_year.as_ref().map(|o| *o)
}
#[inline]
pub fn default_day_of_year(&self) -> Option<i32> {
self.default_day_of_year.as_ref().map(|o| *o)
}
}