Skip to main content

nominal_api_conjure/conjure/objects/scout/run/api/
search_runs_response.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 SearchRunsResponse {
16    #[builder(default, list(item(type = super::Run)))]
17    #[serde(rename = "results", skip_serializing_if = "Vec::is_empty", default)]
18    results: Vec<super::Run>,
19    #[builder(default, into)]
20    #[serde(rename = "nextPageToken", skip_serializing_if = "Option::is_none", default)]
21    next_page_token: Option<String>,
22    #[builder(default, into)]
23    #[serde(rename = "totalCount", skip_serializing_if = "Option::is_none", default)]
24    total_count: Option<i32>,
25}
26impl SearchRunsResponse {
27    /// Constructs a new instance of the type.
28    #[inline]
29    pub fn new() -> Self {
30        Self::builder().build()
31    }
32    #[inline]
33    pub fn results(&self) -> &[super::Run] {
34        &*self.results
35    }
36    #[inline]
37    pub fn next_page_token(&self) -> Option<&str> {
38        self.next_page_token.as_ref().map(|o| &**o)
39    }
40    /// The number of runs matching the query, workspace, and archived filters. Present only when
41    /// includeMatchCount was set to true on the request.
42    #[inline]
43    pub fn total_count(&self) -> Option<i32> {
44        self.total_count.as_ref().map(|o| *o)
45    }
46}