Skip to main content

nominal_api/conjure/objects/scout/checks/api/
completed.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct Completed {
13    #[builder(custom(type = super::JobResult, convert = Box::new))]
14    #[serde(rename = "result")]
15    result: Box<super::JobResult>,
16    #[serde(rename = "executionStartTime")]
17    execution_start_time: conjure_object::DateTime<conjure_object::Utc>,
18    #[serde(rename = "executionEndTime")]
19    execution_end_time: conjure_object::DateTime<conjure_object::Utc>,
20}
21impl Completed {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(
25        result: super::JobResult,
26        execution_start_time: conjure_object::DateTime<conjure_object::Utc>,
27        execution_end_time: conjure_object::DateTime<conjure_object::Utc>,
28    ) -> Self {
29        Self::builder()
30            .result(result)
31            .execution_start_time(execution_start_time)
32            .execution_end_time(execution_end_time)
33            .build()
34    }
35    #[inline]
36    pub fn result(&self) -> &super::JobResult {
37        &*self.result
38    }
39    #[inline]
40    pub fn execution_start_time(&self) -> conjure_object::DateTime<conjure_object::Utc> {
41        self.execution_start_time
42    }
43    #[inline]
44    pub fn execution_end_time(&self) -> conjure_object::DateTime<conjure_object::Utc> {
45        self.execution_end_time
46    }
47}