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