Skip to main content

nominal_api/conjure/objects/timeseries/logicalseries/api/
api_locator.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 ApiLocator {
16    #[builder(into)]
17    #[serde(rename = "channel")]
18    channel: String,
19    #[builder(default, map(key(type = String, into), value(type = String, into)))]
20    #[serde(
21        rename = "tags",
22        skip_serializing_if = "std::collections::BTreeMap::is_empty",
23        default
24    )]
25    tags: std::collections::BTreeMap<String, String>,
26    #[serde(rename = "type")]
27    type_: super::ApiType,
28}
29impl ApiLocator {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new(channel: impl Into<String>, type_: super::ApiType) -> Self {
33        Self::builder().channel(channel).type_(type_).build()
34    }
35    #[inline]
36    pub fn channel(&self) -> &str {
37        &*self.channel
38    }
39    #[inline]
40    pub fn tags(&self) -> &std::collections::BTreeMap<String, String> {
41        &self.tags
42    }
43    #[inline]
44    pub fn type_(&self) -> &super::ApiType {
45        &self.type_
46    }
47}