#[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 CreateOrUpdateRunRequest {
    #[builder(default, into)]
    #[serde(rename = "runRid", skip_serializing_if = "Option::is_none", default)]
    run_rid: Option<super::RunRid>,
    #[builder(custom(type = super::CreateRunRequest, convert = Box::new))]
    #[serde(rename = "createRunRequest")]
    create_run_request: Box<super::CreateRunRequest>,
}
impl CreateOrUpdateRunRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(create_run_request: super::CreateRunRequest) -> Self {
        Self::builder().create_run_request(create_run_request).build()
    }
    /// If a run with the same rid already exists, it will be updated.
    /// Otherwise, a new run will be created.
    #[inline]
    pub fn run_rid(&self) -> Option<&super::RunRid> {
        self.run_rid.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn create_run_request(&self) -> &super::CreateRunRequest {
        &*self.create_run_request
    }
}
