Skip to main content

nominal_api/conjure/objects/scout/catalog/
channel.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 Channel {
16    #[serde(rename = "uuid")]
17    uuid: conjure_object::Uuid,
18    #[builder(into)]
19    #[serde(rename = "name")]
20    name: String,
21    #[serde(rename = "datasetUuid")]
22    dataset_uuid: conjure_object::Uuid,
23}
24impl Channel {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(
28        uuid: conjure_object::Uuid,
29        name: impl Into<String>,
30        dataset_uuid: conjure_object::Uuid,
31    ) -> Self {
32        Self::builder().uuid(uuid).name(name).dataset_uuid(dataset_uuid).build()
33    }
34    #[inline]
35    pub fn uuid(&self) -> conjure_object::Uuid {
36        self.uuid
37    }
38    #[inline]
39    pub fn name(&self) -> &str {
40        &*self.name
41    }
42    #[inline]
43    pub fn dataset_uuid(&self) -> conjure_object::Uuid {
44        self.dataset_uuid
45    }
46}