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