Skip to main content

nominal_api/conjure/objects/scout/catalog/
search_datasets_request.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 SearchDatasetsRequest {
16    #[builder(custom(type = super::SearchDatasetsQuery, convert = Box::new))]
17    #[serde(rename = "query")]
18    query: Box<super::SearchDatasetsQuery>,
19    #[builder(default, into)]
20    #[serde(rename = "pageSize", skip_serializing_if = "Option::is_none", default)]
21    page_size: Option<i32>,
22    #[builder(default, into)]
23    #[serde(rename = "token", skip_serializing_if = "Option::is_none", default)]
24    token: Option<super::super::super::api::Token>,
25    #[builder(custom(type = super::SortOptions, convert = Box::new))]
26    #[serde(rename = "sortOptions")]
27    sort_options: Box<super::SortOptions>,
28}
29impl SearchDatasetsRequest {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new(
33        query: super::SearchDatasetsQuery,
34        sort_options: super::SortOptions,
35    ) -> Self {
36        Self::builder().query(query).sort_options(sort_options).build()
37    }
38    #[inline]
39    pub fn query(&self) -> &super::SearchDatasetsQuery {
40        &*self.query
41    }
42    /// Defaults to 100. Will throw if larger than 1000.
43    #[inline]
44    pub fn page_size(&self) -> Option<i32> {
45        self.page_size.as_ref().map(|o| *o)
46    }
47    #[inline]
48    pub fn token(&self) -> Option<&super::super::super::api::Token> {
49        self.token.as_ref().map(|o| &*o)
50    }
51    #[inline]
52    pub fn sort_options(&self) -> &super::SortOptions {
53        &*self.sort_options
54    }
55}