nominal-api 0.1240.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 NewDataSource {
    #[builder(custom(type = super::IngestSource, convert = Box::new))]
    #[serde(rename = "source")]
    source: Box<super::IngestSource>,
    #[builder(
        default,
        map(
            key(type = super::super::super::api::PropertyName),
            value(type = super::super::super::api::PropertyValue)
        )
    )]
    #[serde(
        rename = "properties",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    properties: std::collections::BTreeMap<
        super::super::super::api::PropertyName,
        super::super::super::api::PropertyValue,
    >,
    #[builder(default, set(item(type = super::super::super::api::Label)))]
    #[serde(
        rename = "labels",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    labels: std::collections::BTreeSet<super::super::super::api::Label>,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "name", skip_serializing_if = "Option::is_none", default)]
    name: Option<String>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::TimestampMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "timeColumnSpec", skip_serializing_if = "Option::is_none", default)]
    time_column_spec: Option<Box<super::TimestampMetadata>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::ChannelConfig>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "channelConfig", skip_serializing_if = "Option::is_none", default)]
    channel_config: Option<Box<super::ChannelConfig>>,
}
impl NewDataSource {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(source: super::IngestSource) -> Self {
        Self::builder().source(source).build()
    }
    #[inline]
    pub fn source(&self) -> &super::IngestSource {
        &*self.source
    }
    #[inline]
    pub fn properties(
        &self,
    ) -> &std::collections::BTreeMap<
        super::super::super::api::PropertyName,
        super::super::super::api::PropertyValue,
    > {
        &self.properties
    }
    #[inline]
    pub fn labels(
        &self,
    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
        &self.labels
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn name(&self) -> Option<&str> {
        self.name.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn time_column_spec(&self) -> Option<&super::TimestampMetadata> {
        self.time_column_spec.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn channel_config(&self) -> Option<&super::ChannelConfig> {
        self.channel_config.as_ref().map(|o| &**o)
    }
}