#[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 CreateEvent {
    #[builder(default, set(item(type = super::super::scout::rids::api::AssetRid)))]
    #[serde(
        rename = "assetRids",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    asset_rids: std::collections::BTreeSet<super::super::scout::rids::api::AssetRid>,
    #[builder(default, set(item(type = super::EventOrigin)))]
    #[serde(
        rename = "origins",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    origins: std::collections::BTreeSet<super::EventOrigin>,
    #[builder(custom(type = super::super::api::Timestamp, convert = Box::new))]
    #[serde(rename = "timestamp")]
    timestamp: Box<super::super::api::Timestamp>,
    #[builder(
        custom(type = super::super::scout::run::api::Duration, convert = Box::new)
    )]
    #[serde(rename = "duration")]
    duration: Box<super::super::scout::run::api::Duration>,
    #[builder(into)]
    #[serde(rename = "name")]
    name: String,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[serde(rename = "type")]
    type_: super::EventType,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "labels",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    labels: std::collections::BTreeSet<String>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "properties",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    properties: std::collections::BTreeMap<String, String>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::EventDisposition>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "disposition", skip_serializing_if = "Option::is_none", default)]
    disposition: Option<Box<super::EventDisposition>>,
}
impl CreateEvent {
    /// Must contain at least one asset rid.
    #[inline]
    pub fn asset_rids(
        &self,
    ) -> &std::collections::BTreeSet<super::super::scout::rids::api::AssetRid> {
        &self.asset_rids
    }
    /// If empty, will default to set<EventOrigin.api>.
    #[inline]
    pub fn origins(&self) -> &std::collections::BTreeSet<super::EventOrigin> {
        &self.origins
    }
    #[inline]
    pub fn timestamp(&self) -> &super::super::api::Timestamp {
        &*self.timestamp
    }
    #[inline]
    pub fn duration(&self) -> &super::super::scout::run::api::Duration {
        &*self.duration
    }
    #[inline]
    pub fn name(&self) -> &str {
        &*self.name
    }
    /// If not provided, will default to an empty string.
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn type_(&self) -> &super::EventType {
        &self.type_
    }
    #[inline]
    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
        &self.labels
    }
    #[inline]
    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
        &self.properties
    }
    #[inline]
    pub fn disposition(&self) -> Option<&super::EventDisposition> {
        self.disposition.as_ref().map(|o| &**o)
    }
}
