Skip to main content

nominal_api/conjure/objects/datasource/api/
search_hierarchical_channels_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 SearchHierarchicalChannelsRequest {
16    #[builder(default, list(item(type = String, into)))]
17    #[serde(rename = "parent", skip_serializing_if = "Vec::is_empty", default)]
18    parent: Vec<String>,
19    #[builder(default, set(item(type = conjure_object::ResourceIdentifier)))]
20    #[serde(
21        rename = "dataSources",
22        skip_serializing_if = "std::collections::BTreeSet::is_empty",
23        default
24    )]
25    data_sources: std::collections::BTreeSet<conjure_object::ResourceIdentifier>,
26    #[builder(
27        default,
28        custom(
29            type = impl
30            Into<Option<super::DataScopeFilters>>,
31            convert = |v|v.into().map(Box::new)
32        )
33    )]
34    #[serde(
35        rename = "dataScopeFilters",
36        skip_serializing_if = "Option::is_none",
37        default
38    )]
39    data_scope_filters: Option<Box<super::DataScopeFilters>>,
40}
41impl SearchHierarchicalChannelsRequest {
42    /// Constructs a new instance of the type.
43    #[inline]
44    pub fn new() -> Self {
45        Self::builder().build()
46    }
47    /// The parent (represented as a list of parts) to search under. If empty, will return all top-level channels.
48    #[inline]
49    pub fn parent(&self) -> &[String] {
50        &*self.parent
51    }
52    #[inline]
53    pub fn data_sources(
54        &self,
55    ) -> &std::collections::BTreeSet<conjure_object::ResourceIdentifier> {
56        &self.data_sources
57    }
58    /// When dataScopeFilters are specified, the set of data sources must match the set of data sources in
59    /// DataScopeFilters#tags
60    #[inline]
61    pub fn data_scope_filters(&self) -> Option<&super::DataScopeFilters> {
62        self.data_scope_filters.as_ref().map(|o| &**o)
63    }
64}