nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
#[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 {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(format: impl Into<String>) -> Self {
        Self::builder().format(format).build()
    }
    /// The format string should be in the format of the `DateTimeFormatter` class in Java.
    #[inline]
    pub fn format(&self) -> &str {
        &*self.format
    }
    /// Year is accepted as an optional field for cases like IRIG time format, and will be assumed as current year if not provided.
    #[inline]
    pub fn default_year(&self) -> Option<i32> {
        self.default_year.as_ref().map(|o| *o)
    }
    /// Default day of year is accepted as an optional field for cases like IRIG time format and will be overridden by day of year in time format.
    #[inline]
    pub fn default_day_of_year(&self) -> Option<i32> {
        self.default_day_of_year.as_ref().map(|o| *o)
    }
}