#[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 UpdateEvent {
    #[serde(rename = "uuid")]
    uuid: conjure_object::Uuid,
    #[builder(default, into)]
    #[serde(rename = "rid", skip_serializing_if = "Option::is_none", default)]
    rid: Option<conjure_object::ResourceIdentifier>,
    #[builder(default, into)]
    #[serde(rename = "assetRids", skip_serializing_if = "Option::is_none", default)]
    asset_rids: Option<
        std::collections::BTreeSet<super::super::scout::rids::api::AssetRid>,
    >,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::api::Timestamp>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none", default)]
    timestamp: Option<Box<super::super::api::Timestamp>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::scout::run::api::Duration>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "duration", skip_serializing_if = "Option::is_none", default)]
    duration: Option<Box<super::super::scout::run::api::Duration>>,
    #[builder(default, into)]
    #[serde(rename = "name", skip_serializing_if = "Option::is_none", default)]
    name: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "type", skip_serializing_if = "Option::is_none", default)]
    type_: Option<super::EventType>,
    #[builder(default, into)]
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none", default)]
    labels: Option<std::collections::BTreeSet<String>>,
    #[builder(default, into)]
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none", default)]
    properties: Option<std::collections::BTreeMap<String, String>>,
}
impl UpdateEvent {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(uuid: conjure_object::Uuid) -> Self {
        Self::builder().uuid(uuid).build()
    }
    #[deprecated(note = "This field is deprecated. Use the rid field instead.\n")]
    #[inline]
    pub fn uuid(&self) -> conjure_object::Uuid {
        self.uuid
    }
    /// The unique identifier for the event.
    /// This field is required if the uuid field is not provided.
    #[inline]
    pub fn rid(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.rid.as_ref().map(|o| &*o)
    }
    /// If provided, will replace the existing asset rids.
    /// If provided, must contain at least one asset rid.
    #[inline]
    pub fn asset_rids(
        &self,
    ) -> Option<&std::collections::BTreeSet<super::super::scout::rids::api::AssetRid>> {
        self.asset_rids.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn timestamp(&self) -> Option<&super::super::api::Timestamp> {
        self.timestamp.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn duration(&self) -> Option<&super::super::scout::run::api::Duration> {
        self.duration.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn name(&self) -> Option<&str> {
        self.name.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn type_(&self) -> Option<&super::EventType> {
        self.type_.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn labels(&self) -> Option<&std::collections::BTreeSet<String>> {
        self.labels.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn properties(&self) -> Option<&std::collections::BTreeMap<String, String>> {
        self.properties.as_ref().map(|o| &*o)
    }
}
