Skip to main content

nominal_api/conjure/objects/authentication/api/
user_settings.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 UserSettings {
16    #[builder(default, into)]
17    #[serde(
18        rename = "defaultTimeRangeType",
19        skip_serializing_if = "Option::is_none",
20        default
21    )]
22    default_time_range_type: Option<super::DefaultTimeRangeTypeSetting>,
23    #[builder(default, into)]
24    #[serde(rename = "appearance", skip_serializing_if = "Option::is_none", default)]
25    appearance: Option<super::AppearanceSetting>,
26    #[builder(default, into)]
27    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none", default)]
28    timezone: Option<super::TimezoneSetting>,
29    #[builder(default, into)]
30    #[serde(
31        rename = "timeSeriesHoverTooltipConcise",
32        skip_serializing_if = "Option::is_none",
33        default
34    )]
35    time_series_hover_tooltip_concise: Option<bool>,
36    #[builder(default, into)]
37    #[serde(
38        rename = "chartHoverTooltipMode",
39        skip_serializing_if = "Option::is_none",
40        default
41    )]
42    chart_hover_tooltip_mode: Option<super::ChartTooltipModeSetting>,
43    #[builder(
44        default,
45        custom(
46            type = impl
47            Into<Option<super::DefaultNumberFormatConfigurations>>,
48            convert = |v|v.into().map(Box::new)
49        )
50    )]
51    #[serde(
52        rename = "defaultNumberFormats",
53        skip_serializing_if = "Option::is_none",
54        default
55    )]
56    default_number_formats: Option<Box<super::DefaultNumberFormatConfigurations>>,
57    #[builder(default, into)]
58    #[serde(rename = "vimModeEnabled", skip_serializing_if = "Option::is_none", default)]
59    vim_mode_enabled: Option<bool>,
60}
61impl UserSettings {
62    /// Constructs a new instance of the type.
63    #[inline]
64    pub fn new() -> Self {
65        Self::builder().build()
66    }
67    #[inline]
68    pub fn default_time_range_type(
69        &self,
70    ) -> Option<&super::DefaultTimeRangeTypeSetting> {
71        self.default_time_range_type.as_ref().map(|o| &*o)
72    }
73    #[inline]
74    pub fn appearance(&self) -> Option<&super::AppearanceSetting> {
75        self.appearance.as_ref().map(|o| &*o)
76    }
77    #[inline]
78    pub fn timezone(&self) -> Option<&super::TimezoneSetting> {
79        self.timezone.as_ref().map(|o| &*o)
80    }
81    #[deprecated(
82        note = "Use `chartHoverTooltipMode` instead. If `chartHoverTooltipMode` is not set, this field will be\nused: `true` as `SINGLE` and `false` as `VERBOSE`.\n"
83    )]
84    #[inline]
85    pub fn time_series_hover_tooltip_concise(&self) -> Option<bool> {
86        self.time_series_hover_tooltip_concise.as_ref().map(|o| *o)
87    }
88    #[inline]
89    pub fn chart_hover_tooltip_mode(&self) -> Option<&super::ChartTooltipModeSetting> {
90        self.chart_hover_tooltip_mode.as_ref().map(|o| &*o)
91    }
92    #[inline]
93    pub fn default_number_formats(
94        &self,
95    ) -> Option<&super::DefaultNumberFormatConfigurations> {
96        self.default_number_formats.as_ref().map(|o| &**o)
97    }
98    #[inline]
99    pub fn vim_mode_enabled(&self) -> Option<bool> {
100        self.vim_mode_enabled.as_ref().map(|o| *o)
101    }
102}