Skip to main content

nominal_api/conjure/objects/themes/api/
chart_theme.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 ChartTheme {
16    #[serde(rename = "rid")]
17    rid: super::ChartThemeRid,
18    #[builder(into)]
19    #[serde(rename = "name")]
20    name: String,
21    #[serde(rename = "createdBy")]
22    created_by: conjure_object::ResourceIdentifier,
23    #[serde(rename = "createdAt")]
24    created_at: conjure_object::DateTime<conjure_object::Utc>,
25    #[builder(default, into)]
26    #[serde(rename = "updatedBy", skip_serializing_if = "Option::is_none", default)]
27    updated_by: Option<conjure_object::ResourceIdentifier>,
28    #[builder(default, into)]
29    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none", default)]
30    updated_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
31    #[builder(custom(type = super::ChartThemeContent, convert = Box::new))]
32    #[serde(rename = "content")]
33    content: Box<super::ChartThemeContent>,
34}
35impl ChartTheme {
36    /// Unique resource identifier for the theme.
37    #[inline]
38    pub fn rid(&self) -> &super::ChartThemeRid {
39        &self.rid
40    }
41    /// The name of the theme as defined by the user.
42    #[inline]
43    pub fn name(&self) -> &str {
44        &*self.name
45    }
46    /// The rid of the user who first created the theme.
47    #[inline]
48    pub fn created_by(&self) -> &conjure_object::ResourceIdentifier {
49        &self.created_by
50    }
51    /// The time the theme was created.
52    #[inline]
53    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
54        self.created_at
55    }
56    /// The rid of the user who last updated the theme.
57    #[inline]
58    pub fn updated_by(&self) -> Option<&conjure_object::ResourceIdentifier> {
59        self.updated_by.as_ref().map(|o| &*o)
60    }
61    /// The rid of the user who last updated the theme.
62    #[inline]
63    pub fn updated_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
64        self.updated_at.as_ref().map(|o| *o)
65    }
66    /// Specifies the chart theme styling (e.g. font, legends, axes)
67    #[inline]
68    pub fn content(&self) -> &super::ChartThemeContent {
69        &*self.content
70    }
71}