Skip to main content

nominal_api_conjure/conjure/objects/scout/layout/api/
analyst_layout.rs

1/// A layout for analyst backing workbooks. Panels render inline in the
2/// conversation, so entries carry no positioning — only per-panel
3/// settings, keyed by the panel's viz id in WorkbookContent.charts.
4#[derive(
5    Debug,
6    Clone,
7    conjure_object::serde::Serialize,
8    conjure_object::serde::Deserialize,
9    PartialEq,
10    Eq,
11    PartialOrd,
12    Ord,
13    Hash
14)]
15#[serde(crate = "conjure_object::serde")]
16#[conjure_object::private::staged_builder::staged_builder]
17#[builder(crate = conjure_object::private::staged_builder, update, inline)]
18pub struct AnalystLayout {
19    #[serde(rename = "id")]
20    id: conjure_object::Uuid,
21    #[builder(
22        default,
23        map(
24            key(type = super::super::super::rids::api::VizId),
25            value(type = super::AnalystPanel)
26        )
27    )]
28    #[serde(
29        rename = "panels",
30        skip_serializing_if = "std::collections::BTreeMap::is_empty",
31        default
32    )]
33    panels: std::collections::BTreeMap<
34        super::super::super::rids::api::VizId,
35        super::AnalystPanel,
36    >,
37}
38impl AnalystLayout {
39    /// Constructs a new instance of the type.
40    #[inline]
41    pub fn new(id: conjure_object::Uuid) -> Self {
42        Self::builder().id(id).build()
43    }
44    #[inline]
45    pub fn id(&self) -> conjure_object::Uuid {
46        self.id
47    }
48    #[inline]
49    pub fn panels(
50        &self,
51    ) -> &std::collections::BTreeMap<
52        super::super::super::rids::api::VizId,
53        super::AnalystPanel,
54    > {
55        &self.panels
56    }
57}