/// 3D plot for a spatial dataset or channel (point cloud, BVH mesh, etc.) loaded by RID.
#[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 GeoPlot3dSpatial {
    #[builder(into)]
    #[serde(rename = "plotId")]
    plot_id: String,
    #[builder(default, into)]
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none", default)]
    enabled: Option<bool>,
    #[builder(default, into)]
    #[serde(rename = "label", skip_serializing_if = "Option::is_none", default)]
    label: Option<String>,
    #[serde(rename = "spatialRid")]
    spatial_rid: conjure_object::ResourceIdentifier,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::SpatialColoring>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "coloring", skip_serializing_if = "Option::is_none", default)]
    coloring: Option<Box<super::SpatialColoring>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::GeoPlot3dSpatialProperties>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none", default)]
    properties: Option<Box<super::GeoPlot3dSpatialProperties>>,
}
impl GeoPlot3dSpatial {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        plot_id: impl Into<String>,
        spatial_rid: conjure_object::ResourceIdentifier,
    ) -> Self {
        Self::builder().plot_id(plot_id).spatial_rid(spatial_rid).build()
    }
    #[inline]
    pub fn plot_id(&self) -> &str {
        &*self.plot_id
    }
    #[inline]
    pub fn enabled(&self) -> Option<bool> {
        self.enabled.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn label(&self) -> Option<&str> {
        self.label.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn spatial_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.spatial_rid
    }
    /// How to color the asset. If omitted, renderers use a +Z direction ramp with colormap
    /// VIRIDIS and default bounds (`SpatialColoringGeometryAxis` with axis { x: 0, y: 0, z: 1 }).
    #[deprecated(note = "Use properties instead.")]
    #[inline]
    pub fn coloring(&self) -> Option<&super::SpatialColoring> {
        self.coloring.as_ref().map(|o| &**o)
    }
    /// Full versioned appearance and time-binding properties. Takes precedence over the
    /// deprecated coloring field when present. Absent on plots created before this field
    /// was added; clients should migrate via resolveGeo3dSpatialAppearance.
    #[inline]
    pub fn properties(&self) -> Option<&super::GeoPlot3dSpatialProperties> {
        self.properties.as_ref().map(|o| &**o)
    }
}
