Skip to main content

nominal_api/conjure/objects/scout/compute/api/
compute_with_units_response.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 ComputeWithUnitsResponse {
13    #[builder(custom(type = super::ComputeNodeResponse, convert = Box::new))]
14    #[serde(rename = "computeResult")]
15    compute_result: Box<super::ComputeNodeResponse>,
16    #[builder(custom(type = super::ComputeUnitResult, convert = Box::new))]
17    #[serde(rename = "computeUnit")]
18    compute_unit: Box<super::ComputeUnitResult>,
19}
20impl ComputeWithUnitsResponse {
21    /// Constructs a new instance of the type.
22    #[inline]
23    pub fn new(
24        compute_result: super::ComputeNodeResponse,
25        compute_unit: super::ComputeUnitResult,
26    ) -> Self {
27        Self::builder().compute_result(compute_result).compute_unit(compute_unit).build()
28    }
29    #[inline]
30    pub fn compute_result(&self) -> &super::ComputeNodeResponse {
31        &*self.compute_result
32    }
33    #[inline]
34    pub fn compute_unit(&self) -> &super::ComputeUnitResult {
35        &*self.compute_unit
36    }
37}