nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
/// A 2D grid layout for the value table where cells are laid out in specific
/// rows and columns. Supports hierarchical cell visualisation configurations, favoring when present:
/// the cell's own definition, then the column's, then the row's, then the panel's.
#[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 ValueTableLayoutGrid {
    #[builder(default, into)]
    #[serde(rename = "showRowHeaders", skip_serializing_if = "Option::is_none", default)]
    show_row_headers: Option<bool>,
    #[builder(default, into)]
    #[serde(
        rename = "showColumnHeaders",
        skip_serializing_if = "Option::is_none",
        default
    )]
    show_column_headers: Option<bool>,
    #[builder(default, into)]
    #[serde(rename = "showCellLabels", skip_serializing_if = "Option::is_none", default)]
    show_cell_labels: Option<bool>,
    #[builder(custom(type = super::ValueTableMultiCellConfig, convert = Box::new))]
    #[serde(rename = "gridDefaultCellConfigs")]
    grid_default_cell_configs: Box<super::ValueTableMultiCellConfig>,
    #[builder(default, list(item(type = super::ValueTableGridRowColumnConfig)))]
    #[serde(rename = "columnConfigs", skip_serializing_if = "Vec::is_empty", default)]
    column_configs: Vec<super::ValueTableGridRowColumnConfig>,
    #[builder(default, list(item(type = super::ValueTableGridRowColumnConfig)))]
    #[serde(rename = "rowConfigs", skip_serializing_if = "Vec::is_empty", default)]
    row_configs: Vec<super::ValueTableGridRowColumnConfig>,
    #[serde(rename = "rowCount")]
    row_count: i32,
    #[serde(rename = "columnCount")]
    column_count: i32,
    #[builder(default, list(item(type = super::ValueTableGridValueTableCell)))]
    #[serde(rename = "cells", skip_serializing_if = "Vec::is_empty", default)]
    cells: Vec<super::ValueTableGridValueTableCell>,
}
impl ValueTableLayoutGrid {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        grid_default_cell_configs: super::ValueTableMultiCellConfig,
        row_count: i32,
        column_count: i32,
    ) -> Self {
        Self::builder()
            .grid_default_cell_configs(grid_default_cell_configs)
            .row_count(row_count)
            .column_count(column_count)
            .build()
    }
    /// If true, display row headers.
    #[inline]
    pub fn show_row_headers(&self) -> Option<bool> {
        self.show_row_headers.as_ref().map(|o| *o)
    }
    /// If true, display column headers.
    #[inline]
    pub fn show_column_headers(&self) -> Option<bool> {
        self.show_column_headers.as_ref().map(|o| *o)
    }
    /// If true, display channel names in the cells.
    #[inline]
    pub fn show_cell_labels(&self) -> Option<bool> {
        self.show_cell_labels.as_ref().map(|o| *o)
    }
    /// Panel-level defaults for cell visualisations
    #[inline]
    pub fn grid_default_cell_configs(&self) -> &super::ValueTableMultiCellConfig {
        &*self.grid_default_cell_configs
    }
    /// Column-level configurations.
    #[inline]
    pub fn column_configs(&self) -> &[super::ValueTableGridRowColumnConfig] {
        &*self.column_configs
    }
    /// Row-level configurations.
    #[inline]
    pub fn row_configs(&self) -> &[super::ValueTableGridRowColumnConfig] {
        &*self.row_configs
    }
    #[inline]
    pub fn row_count(&self) -> i32 {
        self.row_count
    }
    #[inline]
    pub fn column_count(&self) -> i32 {
        self.column_count
    }
    /// An array of cells to display in the table.
    #[inline]
    pub fn cells(&self) -> &[super::ValueTableGridValueTableCell] {
        &*self.cells
    }
}