Skip to main content

nominal_api/conjure/objects/scout/compute/api/
compute_node_request.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 ComputeNodeRequest {
13    #[builder(custom(type = super::ComputableNode, convert = Box::new))]
14    #[serde(rename = "node")]
15    node: Box<super::ComputableNode>,
16    #[builder(
17        custom(type = super::super::super::super::api::Timestamp, convert = Box::new)
18    )]
19    #[serde(rename = "start")]
20    start: Box<super::super::super::super::api::Timestamp>,
21    #[builder(
22        custom(type = super::super::super::super::api::Timestamp, convert = Box::new)
23    )]
24    #[serde(rename = "end")]
25    end: Box<super::super::super::super::api::Timestamp>,
26    #[builder(custom(type = super::Context, convert = Box::new))]
27    #[serde(rename = "context")]
28    context: Box<super::Context>,
29    #[builder(default, into)]
30    #[serde(rename = "sourceRid", skip_serializing_if = "Option::is_none", default)]
31    source_rid: Option<conjure_object::ResourceIdentifier>,
32    #[builder(default, into)]
33    #[serde(rename = "requestId", skip_serializing_if = "Option::is_none", default)]
34    request_id: Option<conjure_object::Uuid>,
35}
36impl ComputeNodeRequest {
37    #[inline]
38    pub fn node(&self) -> &super::ComputableNode {
39        &*self.node
40    }
41    /// The start of the time range (inclusive).
42    #[inline]
43    pub fn start(&self) -> &super::super::super::super::api::Timestamp {
44        &*self.start
45    }
46    /// The end of the time range (inclusive).
47    #[inline]
48    pub fn end(&self) -> &super::super::super::super::api::Timestamp {
49        &*self.end
50    }
51    #[inline]
52    pub fn context(&self) -> &super::Context {
53        &*self.context
54    }
55    /// Optional RID identifying the resource that initiated this query (e.g. workbook/notebook RID, checklist RID).
56    /// Used for observability only — trusted as-is, no permission checks are performed on this value.
57    #[inline]
58    pub fn source_rid(&self) -> Option<&conjure_object::ResourceIdentifier> {
59        self.source_rid.as_ref().map(|o| &*o)
60    }
61    /// Optional UUID to provide as a handle to selectively cancel the execution of this compute request.
62    #[inline]
63    pub fn request_id(&self) -> Option<conjure_object::Uuid> {
64        self.request_id.as_ref().map(|o| *o)
65    }
66}