nominal-api-conjure 0.1352.0

Conjure HTTP API bindings for the Nominal platform
Documentation
/// A layout of a document with its text editor raw state JSON
/// and node objects such as panels metadata.
#[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 DocumentLayout {
    #[serde(rename = "id")]
    id: conjure_object::Uuid,
    #[builder(into)]
    #[serde(rename = "textEditorJson")]
    text_editor_json: String,
    #[builder(
        default,
        map(key(type = conjure_object::Uuid), value(type = super::DocumentNodeObject))
    )]
    #[serde(
        rename = "nodes",
        serialize_with = "conjure_object::private::serialize_map_keys_as_strings",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    nodes: std::collections::BTreeMap<conjure_object::Uuid, super::DocumentNodeObject>,
}
impl DocumentLayout {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(id: conjure_object::Uuid, text_editor_json: impl Into<String>) -> Self {
        Self::builder().id(id).text_editor_json(text_editor_json).build()
    }
    #[inline]
    pub fn id(&self) -> conjure_object::Uuid {
        self.id
    }
    #[inline]
    pub fn text_editor_json(&self) -> &str {
        &*self.text_editor_json
    }
    #[inline]
    pub fn nodes(
        &self,
    ) -> &std::collections::BTreeMap<conjure_object::Uuid, super::DocumentNodeObject> {
        &self.nodes
    }
}