Skip to main content

nominal_api/conjure/objects/scout/compute/api/
search_frame.rs

1/// Resolves matching assets or runs from search, creating a combined frame tagged by source rid and data scope.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct SearchFrame {
17    #[builder(custom(type = super::SearchTarget, convert = Box::new))]
18    #[serde(rename = "target")]
19    target: Box<super::SearchTarget>,
20    #[builder(default, into)]
21    #[serde(rename = "maxResults", skip_serializing_if = "Option::is_none", default)]
22    max_results: Option<i32>,
23}
24impl SearchFrame {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(target: super::SearchTarget) -> Self {
28        Self::builder().target(target).build()
29    }
30    /// Whether to search assets or runs and with which query.
31    #[inline]
32    pub fn target(&self) -> &super::SearchTarget {
33        &*self.target
34    }
35    /// Maximum number of assets or runs returned from search. Defaults to 100 when omitted.
36    #[inline]
37    pub fn max_results(&self) -> Option<i32> {
38        self.max_results.as_ref().map(|o| *o)
39    }
40}