#[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 GetRunByIdRequest {
    #[serde(rename = "runNumber")]
    run_number: conjure_object::SafeLong,
    #[builder(default, into)]
    #[serde(rename = "runPrefix", skip_serializing_if = "Option::is_none", default)]
    run_prefix: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
    workspace: Option<conjure_object::ResourceIdentifier>,
}
impl GetRunByIdRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(run_number: conjure_object::SafeLong) -> Self {
        Self::builder().run_number(run_number).build()
    }
    #[inline]
    pub fn run_number(&self) -> conjure_object::SafeLong {
        self.run_number
    }
    #[inline]
    pub fn run_prefix(&self) -> Option<&str> {
        self.run_prefix.as_ref().map(|o| &**o)
    }
    /// The workspace in which to query for the run. If not provided, the run
    /// will be queried in the default workspace for the user's organization,
    /// if the default workspace for the organization is configured and the user
    /// has access to it.
    #[inline]
    pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.workspace.as_ref().map(|o| &*o)
    }
}
