Skip to main content

nominal_api/conjure/objects/scout/metadata/
find_similar_label_matches_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 FindSimilarLabelMatchesRequest {
16    #[builder(default, into)]
17    #[serde(rename = "resourceTypes", skip_serializing_if = "Option::is_none", default)]
18    resource_types: Option<std::collections::BTreeSet<super::ResourceType>>,
19    #[builder(default, into)]
20    #[serde(rename = "workspaces", skip_serializing_if = "Option::is_none", default)]
21    workspaces: Option<std::collections::BTreeSet<conjure_object::ResourceIdentifier>>,
22    #[builder(default, set(item(type = String, into)))]
23    #[serde(
24        rename = "labels",
25        skip_serializing_if = "std::collections::BTreeSet::is_empty",
26        default
27    )]
28    labels: std::collections::BTreeSet<String>,
29}
30impl FindSimilarLabelMatchesRequest {
31    /// Constructs a new instance of the type.
32    #[inline]
33    pub fn new() -> Self {
34        Self::builder().build()
35    }
36    /// If omitted, all resource types are included.
37    #[inline]
38    pub fn resource_types(
39        &self,
40    ) -> Option<&std::collections::BTreeSet<super::ResourceType>> {
41        self.resource_types.as_ref().map(|o| &*o)
42    }
43    /// If omitted, results will come from all workspaces the user belongs to.
44    #[inline]
45    pub fn workspaces(
46        &self,
47    ) -> Option<&std::collections::BTreeSet<conjure_object::ResourceIdentifier>> {
48        self.workspaces.as_ref().map(|o| &*o)
49    }
50    #[inline]
51    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
52        &self.labels
53    }
54}