Skip to main content

nominal_api/conjure/objects/secrets/api/
search_secrets_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 SearchSecretsRequest {
16    #[builder(custom(type = super::SearchSecretsQuery, convert = Box::new))]
17    #[serde(rename = "query")]
18    query: Box<super::SearchSecretsQuery>,
19    #[builder(default, into)]
20    #[serde(rename = "pageSize", skip_serializing_if = "Option::is_none", default)]
21    page_size: Option<i32>,
22    #[builder(custom(type = super::SortOptions, convert = Box::new))]
23    #[serde(rename = "sort")]
24    sort: Box<super::SortOptions>,
25    #[builder(default, into)]
26    #[serde(rename = "token", skip_serializing_if = "Option::is_none", default)]
27    token: Option<super::super::super::api::Token>,
28    #[builder(default, into)]
29    #[serde(
30        rename = "archivedStatuses",
31        skip_serializing_if = "Option::is_none",
32        default
33    )]
34    archived_statuses: Option<
35        std::collections::BTreeSet<super::super::super::api::ArchivedStatus>,
36    >,
37}
38impl SearchSecretsRequest {
39    /// Constructs a new instance of the type.
40    #[inline]
41    pub fn new(query: super::SearchSecretsQuery, sort: super::SortOptions) -> Self {
42        Self::builder().query(query).sort(sort).build()
43    }
44    #[inline]
45    pub fn query(&self) -> &super::SearchSecretsQuery {
46        &*self.query
47    }
48    /// Defaults to 100. Will throw if larger than 1000.
49    #[inline]
50    pub fn page_size(&self) -> Option<i32> {
51        self.page_size.as_ref().map(|o| *o)
52    }
53    #[inline]
54    pub fn sort(&self) -> &super::SortOptions {
55        &*self.sort
56    }
57    #[inline]
58    pub fn token(&self) -> Option<&super::super::super::api::Token> {
59        self.token.as_ref().map(|o| &*o)
60    }
61    /// Default search status is NOT_ARCHIVED if none are provided. Allows for including archived secrets in search.
62    #[inline]
63    pub fn archived_statuses(
64        &self,
65    ) -> Option<&std::collections::BTreeSet<super::super::super::api::ArchivedStatus>> {
66        self.archived_statuses.as_ref().map(|o| &*o)
67    }
68}