nominal-api-conjure 0.1331.0

Conjure HTTP API bindings for the Nominal platform
Documentation
/// Per-output timestamp metadata for a containerized extractor output.
///
/// Numeric epoch timestamps (absolute) and relative timestamps (a numeric offset from a
/// starting epoch) are expressible here. Outputs that need richer timestamp types (ISO 8601,
/// custom string formats) should omit this and rely on the job-level timestamp metadata,
/// which supports the full TimestampType range.
#[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 ManifestTimestampMetadata {
    #[builder(into)]
    #[serde(rename = "seriesName")]
    series_name: String,
    #[serde(rename = "epochTimeUnit")]
    epoch_time_unit: super::ManifestEpochTimeUnit,
    #[builder(default, into)]
    #[serde(rename = "relativeOffset", skip_serializing_if = "Option::is_none", default)]
    relative_offset: Option<conjure_object::DateTime<conjure_object::Utc>>,
}
impl ManifestTimestampMetadata {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        series_name: impl Into<String>,
        epoch_time_unit: super::ManifestEpochTimeUnit,
    ) -> Self {
        Self::builder().series_name(series_name).epoch_time_unit(epoch_time_unit).build()
    }
    /// Name of the column (TABULAR) or top-level JSON field (JSON_L) that holds the timestamp
    /// for this output.
    #[inline]
    pub fn series_name(&self) -> &str {
        &*self.series_name
    }
    /// Time unit of the numeric timestamp stored in seriesName.
    #[inline]
    pub fn epoch_time_unit(&self) -> &super::ManifestEpochTimeUnit {
        &self.epoch_time_unit
    }
    /// When set, the numeric values in seriesName are interpreted as RELATIVE offsets from
    /// this starting timestamp, measured in epochTimeUnit units (e.g. seconds since the
    /// offset). This mirrors relative timestamp extraction in regular ingest and makes
    /// post-extraction timestamp surgery easier than requiring absolute timestamps
    /// everywhere. When absent, the values are absolute epoch timestamps in epochTimeUnit
    /// units, preserving existing behavior.
    #[inline]
    pub fn relative_offset(
        &self,
    ) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.relative_offset.as_ref().map(|o| *o)
    }
}