Skip to main content

nominal_api/conjure/objects/authentication/api/
default_number_format_configurations.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 DefaultNumberFormatConfigurations {
16    #[builder(
17        default,
18        custom(
19            type = impl
20            Into<Option<super::super::super::scout::chartdefinition::api::NumberFormat>>,
21            convert = |v|v.into().map(Box::new)
22        )
23    )]
24    #[serde(rename = "data", skip_serializing_if = "Option::is_none", default)]
25    data: Option<Box<super::super::super::scout::chartdefinition::api::NumberFormat>>,
26}
27impl DefaultNumberFormatConfigurations {
28    /// Constructs a new instance of the type.
29    #[inline]
30    pub fn new() -> Self {
31        Self::builder().build()
32    }
33    /// Default number format for data values, e.g. chart tooltip and value table cell values.
34    #[inline]
35    pub fn data(
36        &self,
37    ) -> Option<&super::super::super::scout::chartdefinition::api::NumberFormat> {
38        self.data.as_ref().map(|o| &**o)
39    }
40}