figma-api 0.31.4

This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api). Note: we are releasing the OpenAPI specification as a beta given the large surface area and complexity of the REST API. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues).
Documentation
/*
 * Figma API
 *
 * This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api).  Note: we are releasing the OpenAPI specification as a beta given the large surface area and complexity of the REST API. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues).
 *
 * The version of the OpenAPI document: 0.31.0
 * Contact: support@figma.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// LayoutGrid : Guides to align and place objects within a frames.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LayoutGrid {
    /// Orientation of the grid as a string enum  - `COLUMNS`: Vertical grid - `ROWS`: Horizontal grid - `GRID`: Square grid
    #[serde(rename = "pattern")]
    pub pattern: Pattern,
    /// Width of column grid or height of row grid or square grid spacing.
    #[serde(rename = "sectionSize")]
    pub section_size: f64,
    /// Is the grid currently visible?
    #[serde(rename = "visible")]
    pub visible: bool,
    /// Color of the grid
    #[serde(rename = "color")]
    pub color: Box<models::Rgba>,
    /// Positioning of grid as a string enum  - `MIN`: Grid starts at the left or top of the frame - `MAX`: Grid starts at the right or bottom of the frame - `STRETCH`: Grid is stretched to fit the frame - `CENTER`: Grid is center aligned
    #[serde(rename = "alignment")]
    pub alignment: Alignment,
    /// Spacing in between columns and rows
    #[serde(rename = "gutterSize")]
    pub gutter_size: f64,
    /// Spacing before the first column or row
    #[serde(rename = "offset")]
    pub offset: f64,
    /// Number of columns or rows
    #[serde(rename = "count")]
    pub count: f64,
    #[serde(rename = "boundVariables", skip_serializing_if = "Option::is_none")]
    pub bound_variables: Option<Box<models::LayoutGridBoundVariables>>,
}

impl LayoutGrid {
    /// Guides to align and place objects within a frames.
    pub fn new(pattern: Pattern, section_size: f64, visible: bool, color: models::Rgba, alignment: Alignment, gutter_size: f64, offset: f64, count: f64) -> LayoutGrid {
        LayoutGrid {
            pattern,
            section_size,
            visible,
            color: Box::new(color),
            alignment,
            gutter_size,
            offset,
            count,
            bound_variables: None,
        }
    }
}
/// Orientation of the grid as a string enum  - `COLUMNS`: Vertical grid - `ROWS`: Horizontal grid - `GRID`: Square grid
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Pattern {
    #[serde(rename = "COLUMNS")]
    Columns,
    #[serde(rename = "ROWS")]
    Rows,
    #[serde(rename = "GRID")]
    Grid,
}

impl Default for Pattern {
    fn default() -> Pattern {
        Self::Columns
    }
}
/// Positioning of grid as a string enum  - `MIN`: Grid starts at the left or top of the frame - `MAX`: Grid starts at the right or bottom of the frame - `STRETCH`: Grid is stretched to fit the frame - `CENTER`: Grid is center aligned
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Alignment {
    #[serde(rename = "MIN")]
    Min,
    #[serde(rename = "MAX")]
    Max,
    #[serde(rename = "STRETCH")]
    Stretch,
    #[serde(rename = "CENTER")]
    Center,
}

impl Default for Alignment {
    fn default() -> Alignment {
        Self::Min
    }
}