/// A custom distance annotation on the map. Units for distance are inherited from GeoVizDefinitionV1
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct GeoCustomMeasurement {
    #[builder(default, into)]
    #[serde(rename = "label", skip_serializing_if = "Option::is_none", default)]
    label: Option<String>,
    #[builder(custom(type = super::GeoCoordinate, convert = Box::new))]
    #[serde(rename = "startCoordinate")]
    start_coordinate: Box<super::GeoCoordinate>,
    #[builder(custom(type = super::GeoCoordinate, convert = Box::new))]
    #[serde(rename = "endCoordinate")]
    end_coordinate: Box<super::GeoCoordinate>,
    #[builder(custom(type = super::GeoPlotVisualizationOptions, convert = Box::new))]
    #[serde(rename = "visualizationOptions")]
    visualization_options: Box<super::GeoPlotVisualizationOptions>,
}
impl GeoCustomMeasurement {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        start_coordinate: super::GeoCoordinate,
        end_coordinate: super::GeoCoordinate,
        visualization_options: super::GeoPlotVisualizationOptions,
    ) -> Self {
        Self::builder()
            .start_coordinate(start_coordinate)
            .end_coordinate(end_coordinate)
            .visualization_options(visualization_options)
            .build()
    }
    #[inline]
    pub fn label(&self) -> Option<&str> {
        self.label.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn start_coordinate(&self) -> &super::GeoCoordinate {
        &*self.start_coordinate
    }
    #[inline]
    pub fn end_coordinate(&self) -> &super::GeoCoordinate {
        &*self.end_coordinate
    }
    #[inline]
    pub fn visualization_options(&self) -> &super::GeoPlotVisualizationOptions {
        &*self.visualization_options
    }
}
