Skip to main content

nominal_api/conjure/objects/scout/comparisonrun/api/
comparison_run.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct ComparisonRun {
16    #[serde(rename = "runRid")]
17    run_rid: super::super::super::run::api::RunRid,
18    #[serde(rename = "enabled")]
19    enabled: bool,
20    #[builder(
21        default,
22        custom(
23            type = impl
24            Into<Option<super::Offset>>,
25            convert = |v|v.into().map(Box::new)
26        )
27    )]
28    #[serde(rename = "offsetOverride", skip_serializing_if = "Option::is_none", default)]
29    offset_override: Option<Box<super::Offset>>,
30}
31impl ComparisonRun {
32    /// Constructs a new instance of the type.
33    #[inline]
34    pub fn new(run_rid: super::super::super::run::api::RunRid, enabled: bool) -> Self {
35        Self::builder().run_rid(run_rid).enabled(enabled).build()
36    }
37    #[inline]
38    pub fn run_rid(&self) -> &super::super::super::run::api::RunRid {
39        &self.run_rid
40    }
41    #[inline]
42    pub fn enabled(&self) -> bool {
43        self.enabled
44    }
45    #[inline]
46    pub fn offset_override(&self) -> Option<&super::Offset> {
47        self.offset_override.as_ref().map(|o| &**o)
48    }
49}