/// A standard workbook panel placed on a canvas.
#[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 CanvasPanel {
    #[builder(custom(type = super::CanvasRect, convert = Box::new))]
    #[serde(rename = "rect")]
    rect: Box<super::CanvasRect>,
    #[builder(default, into)]
    #[serde(rename = "hideLegend", skip_serializing_if = "Option::is_none", default)]
    hide_legend: Option<bool>,
}
impl CanvasPanel {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(rect: super::CanvasRect) -> Self {
        Self::builder().rect(rect).build()
    }
    #[inline]
    pub fn rect(&self) -> &super::CanvasRect {
        &*self.rect
    }
    #[inline]
    pub fn hide_legend(&self) -> Option<bool> {
        self.hide_legend.as_ref().map(|o| *o)
    }
}
