Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
geo_viz_definition_v1.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct GeoVizDefinitionV1 {
13    #[builder(default, list(item(type = super::GeoPlotFromLatLong)))]
14    #[serde(rename = "plots", skip_serializing_if = "Vec::is_empty", default)]
15    plots: Vec<super::GeoPlotFromLatLong>,
16    #[builder(default, into)]
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
18    title: Option<String>,
19    #[builder(default, list(item(type = super::GeoCustomFeature)))]
20    #[serde(rename = "customFeatures", skip_serializing_if = "Vec::is_empty", default)]
21    custom_features: Vec<super::GeoCustomFeature>,
22    #[builder(default, into)]
23    #[serde(rename = "baseTileset", skip_serializing_if = "Option::is_none", default)]
24    base_tileset: Option<super::GeoBaseTileset>,
25    #[builder(default, into)]
26    #[serde(
27        rename = "additionalTileset",
28        skip_serializing_if = "Option::is_none",
29        default
30    )]
31    additional_tileset: Option<super::GeoAdditionalTileset>,
32}
33impl GeoVizDefinitionV1 {
34    /// Constructs a new instance of the type.
35    #[inline]
36    pub fn new() -> Self {
37        Self::builder().build()
38    }
39    #[inline]
40    pub fn plots(&self) -> &[super::GeoPlotFromLatLong] {
41        &*self.plots
42    }
43    #[inline]
44    pub fn title(&self) -> Option<&str> {
45        self.title.as_ref().map(|o| &**o)
46    }
47    #[inline]
48    pub fn custom_features(&self) -> &[super::GeoCustomFeature] {
49        &*self.custom_features
50    }
51    #[inline]
52    pub fn base_tileset(&self) -> Option<&super::GeoBaseTileset> {
53        self.base_tileset.as_ref().map(|o| &*o)
54    }
55    #[inline]
56    pub fn additional_tileset(&self) -> Option<&super::GeoAdditionalTileset> {
57        self.additional_tileset.as_ref().map(|o| &*o)
58    }
59}