Skip to main content

nominal_api/conjure/objects/scout/datareview/api/
find_data_reviews_request.rs

1/// If both sets are empty, an empty page is returned.
2/// If one set is empty, that field is not considered for filtering (like a wildcard).
3/// If commitId is omitted from a ChecklistRef, it will match all commits.
4#[derive(
5    Debug,
6    Clone,
7    conjure_object::serde::Serialize,
8    conjure_object::serde::Deserialize,
9    PartialEq,
10    Eq,
11    PartialOrd,
12    Ord,
13    Hash
14)]
15#[serde(crate = "conjure_object::serde")]
16#[conjure_object::private::staged_builder::staged_builder]
17#[builder(crate = conjure_object::private::staged_builder, update, inline)]
18pub struct FindDataReviewsRequest {
19    #[builder(default, set(item(type = super::super::super::run::api::RunRid)))]
20    #[serde(
21        rename = "runRids",
22        skip_serializing_if = "std::collections::BTreeSet::is_empty",
23        default
24    )]
25    run_rids: std::collections::BTreeSet<super::super::super::run::api::RunRid>,
26    #[builder(default, set(item(type = super::super::super::rids::api::AssetRid)))]
27    #[serde(
28        rename = "assetRids",
29        skip_serializing_if = "std::collections::BTreeSet::is_empty",
30        default
31    )]
32    asset_rids: std::collections::BTreeSet<super::super::super::rids::api::AssetRid>,
33    #[builder(default, into)]
34    #[serde(
35        rename = "filterByBothRunsAndAssets",
36        skip_serializing_if = "Option::is_none",
37        default
38    )]
39    filter_by_both_runs_and_assets: Option<bool>,
40    #[builder(default, set(item(type = super::super::super::checks::api::ChecklistRef)))]
41    #[serde(
42        rename = "checklistRefs",
43        skip_serializing_if = "std::collections::BTreeSet::is_empty",
44        default
45    )]
46    checklist_refs: std::collections::BTreeSet<
47        super::super::super::checks::api::ChecklistRef,
48    >,
49    #[builder(default, into)]
50    #[serde(rename = "nextPageToken", skip_serializing_if = "Option::is_none", default)]
51    next_page_token: Option<super::super::super::super::api::Token>,
52    #[builder(default, into)]
53    #[serde(rename = "pageSize", skip_serializing_if = "Option::is_none", default)]
54    page_size: Option<i32>,
55    #[builder(default, into)]
56    #[serde(rename = "showArchived", skip_serializing_if = "Option::is_none", default)]
57    show_archived: Option<bool>,
58    #[builder(default, into)]
59    #[serde(
60        rename = "archivedStatuses",
61        skip_serializing_if = "Option::is_none",
62        default
63    )]
64    archived_statuses: Option<
65        std::collections::BTreeSet<super::super::super::super::api::ArchivedStatus>,
66    >,
67}
68impl FindDataReviewsRequest {
69    /// Constructs a new instance of the type.
70    #[inline]
71    pub fn new() -> Self {
72        Self::builder().build()
73    }
74    #[inline]
75    pub fn run_rids(
76        &self,
77    ) -> &std::collections::BTreeSet<super::super::super::run::api::RunRid> {
78        &self.run_rids
79    }
80    #[inline]
81    pub fn asset_rids(
82        &self,
83    ) -> &std::collections::BTreeSet<super::super::super::rids::api::AssetRid> {
84        &self.asset_rids
85    }
86    /// If true, results are filtered to data reviews w/ both run and asset in the requested runs/assets.
87    /// Defaults to false, where assets are converted to runs and all data reviews under the linked runs
88    /// (including data reviews on other assets sharing the parent run) will be returned.
89    /// It is recommended to set this to true and pass in asset RIDs for multi-asset runs.
90    /// Toggling this option has no effect if no asset RIDs are supplied.
91    #[inline]
92    pub fn filter_by_both_runs_and_assets(&self) -> Option<bool> {
93        self.filter_by_both_runs_and_assets.as_ref().map(|o| *o)
94    }
95    #[inline]
96    pub fn checklist_refs(
97        &self,
98    ) -> &std::collections::BTreeSet<super::super::super::checks::api::ChecklistRef> {
99        &self.checklist_refs
100    }
101    #[inline]
102    pub fn next_page_token(&self) -> Option<&super::super::super::super::api::Token> {
103        self.next_page_token.as_ref().map(|o| &*o)
104    }
105    /// Defaults to 1000. Will throw if larger than 1000.
106    #[inline]
107    pub fn page_size(&self) -> Option<i32> {
108        self.page_size.as_ref().map(|o| *o)
109    }
110    /// To be deprecated. Use archivedStatuses instead. Allows for inclusion of archived data reviews
111    /// in search results alongside non-archived ones. Defaults to false if not specified.
112    #[inline]
113    pub fn show_archived(&self) -> Option<bool> {
114        self.show_archived.as_ref().map(|o| *o)
115    }
116    /// Filters search on data reviews based on the archived statuses provided.
117    /// Default is NOT_ARCHIVED only if none are provided.
118    #[inline]
119    pub fn archived_statuses(
120        &self,
121    ) -> Option<
122        &std::collections::BTreeSet<super::super::super::super::api::ArchivedStatus>,
123    > {
124        self.archived_statuses.as_ref().map(|o| &*o)
125    }
126}