#[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 UpdateRunRequest {
    #[builder(default, into)]
    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
    title: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::UtcTimestamp>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "startTime", skip_serializing_if = "Option::is_none", default)]
    start_time: Option<Box<super::UtcTimestamp>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::UtcTimestamp>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "endTime", skip_serializing_if = "Option::is_none", default)]
    end_time: Option<Box<super::UtcTimestamp>>,
    #[builder(default, into)]
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none", default)]
    properties: Option<std::collections::BTreeMap<String, String>>,
    #[builder(default, into)]
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none", default)]
    labels: Option<std::collections::BTreeSet<String>>,
    #[builder(default, into)]
    #[serde(rename = "links", skip_serializing_if = "Option::is_none", default)]
    links: Option<Vec<super::Link>>,
    #[builder(default, into)]
    #[serde(rename = "runPrefix", skip_serializing_if = "Option::is_none", default)]
    run_prefix: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "dataSources", skip_serializing_if = "Option::is_none", default)]
    data_sources: Option<
        std::collections::BTreeMap<
            super::super::super::api::DataSourceRefName,
            super::CreateRunDataSource,
        >,
    >,
    #[builder(default, into)]
    #[serde(rename = "attachments", skip_serializing_if = "Option::is_none", default)]
    attachments: Option<std::collections::BTreeSet<conjure_object::ResourceIdentifier>>,
    #[builder(default, into)]
    #[serde(rename = "asset", skip_serializing_if = "Option::is_none", default)]
    asset: Option<super::super::super::rids::api::AssetRid>,
    #[builder(default, list(item(type = super::super::super::rids::api::AssetRid)))]
    #[serde(rename = "assets", skip_serializing_if = "Vec::is_empty", default)]
    assets: Vec<super::super::super::rids::api::AssetRid>,
    #[builder(default, into)]
    #[serde(
        rename = "strictOverwrite",
        skip_serializing_if = "Option::is_none",
        default
    )]
    strict_overwrite: Option<bool>,
}
impl UpdateRunRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    #[inline]
    pub fn title(&self) -> Option<&str> {
        self.title.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    /// If strictOverwrite is false, will only update the startTime if it is before the existing startTime.
    #[inline]
    pub fn start_time(&self) -> Option<&super::UtcTimestamp> {
        self.start_time.as_ref().map(|o| &**o)
    }
    /// If strictOverwrite is false, will only update the endTime if it is after the existing endTime.
    #[inline]
    pub fn end_time(&self) -> Option<&super::UtcTimestamp> {
        self.end_time.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn properties(&self) -> Option<&std::collections::BTreeMap<String, String>> {
        self.properties.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 links(&self) -> Option<&[super::Link]> {
        self.links.as_ref().map(|o| &**o)
    }
    /// Pass in an empty string to remove the run prefix.
    #[inline]
    pub fn run_prefix(&self) -> Option<&str> {
        self.run_prefix.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn data_sources(
        &self,
    ) -> Option<
        &std::collections::BTreeMap<
            super::super::super::api::DataSourceRefName,
            super::CreateRunDataSource,
        >,
    > {
        self.data_sources.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn attachments(
        &self,
    ) -> Option<&std::collections::BTreeSet<conjure_object::ResourceIdentifier>> {
        self.attachments.as_ref().map(|o| &*o)
    }
    #[deprecated(note = "Use assets")]
    #[inline]
    pub fn asset(&self) -> Option<&super::super::super::rids::api::AssetRid> {
        self.asset.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn assets(&self) -> &[super::super::super::rids::api::AssetRid] {
        &*self.assets
    }
    /// If true, will blindly overwrite the existing fields with the new values in the request.
    /// If false, will only update the fields if application constraints are maintained.
    /// See individual field docs for more details.
    /// Defaults to true for backwards compatibility.
    #[inline]
    pub fn strict_overwrite(&self) -> Option<bool> {
        self.strict_overwrite.as_ref().map(|o| *o)
    }
}
