/// A layout of objects freely 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 CanvasLayout {
    #[serde(rename = "id")]
    id: conjure_object::Uuid,
    #[builder(
        default,
        map(key(type = conjure_object::Uuid), value(type = super::CanvasObject))
    )]
    #[serde(
        rename = "objects",
        serialize_with = "conjure_object::private::serialize_map_keys_as_strings",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    objects: std::collections::BTreeMap<conjure_object::Uuid, super::CanvasObject>,
}
impl CanvasLayout {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(id: conjure_object::Uuid) -> Self {
        Self::builder().id(id).build()
    }
    #[inline]
    pub fn id(&self) -> conjure_object::Uuid {
        self.id
    }
    #[inline]
    pub fn objects(
        &self,
    ) -> &std::collections::BTreeMap<conjure_object::Uuid, super::CanvasObject> {
        &self.objects
    }
}
