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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct HasFramePropertiesTrait {
    /// Whether or not this node clip content outside of its bounds
    #[serde(rename = "clipsContent")]
    pub clips_content: bool,
    /// Background of the node. This is deprecated, as backgrounds for frames are now in the `fills` field.
    #[serde(rename = "background", skip_serializing_if = "Option::is_none")]
    pub background: Option<Vec<models::Paint>>,
    /// Background color of the node. This is deprecated, as frames now support more than a solid color as a background. Please use the `fills` field instead.
    #[serde(rename = "backgroundColor", skip_serializing_if = "Option::is_none")]
    pub background_color: Option<Box<models::Rgba>>,
    /// An array of layout grids attached to this node (see layout grids section for more details). GROUP nodes do not have this attribute
    #[serde(rename = "layoutGrids", skip_serializing_if = "Option::is_none")]
    pub layout_grids: Option<Vec<models::LayoutGrid>>,
    /// Whether a node has primary axis scrolling, horizontal or vertical.
    #[serde(rename = "overflowDirection", skip_serializing_if = "Option::is_none")]
    pub overflow_direction: Option<OverflowDirection>,
    /// Whether this layer uses auto-layout to position its children.
    #[serde(rename = "layoutMode", skip_serializing_if = "Option::is_none")]
    pub layout_mode: Option<LayoutMode>,
    /// Whether the primary axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
    #[serde(rename = "primaryAxisSizingMode", skip_serializing_if = "Option::is_none")]
    pub primary_axis_sizing_mode: Option<PrimaryAxisSizingMode>,
    /// Whether the counter axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
    #[serde(rename = "counterAxisSizingMode", skip_serializing_if = "Option::is_none")]
    pub counter_axis_sizing_mode: Option<CounterAxisSizingMode>,
    /// Determines how the auto-layout frame's children should be aligned in the primary axis direction. This property is only applicable for auto-layout frames.
    #[serde(rename = "primaryAxisAlignItems", skip_serializing_if = "Option::is_none")]
    pub primary_axis_align_items: Option<PrimaryAxisAlignItems>,
    /// Determines how the auto-layout frame's children should be aligned in the counter axis direction. This property is only applicable for auto-layout frames.
    #[serde(rename = "counterAxisAlignItems", skip_serializing_if = "Option::is_none")]
    pub counter_axis_align_items: Option<CounterAxisAlignItems>,
    /// The padding between the left border of the frame and its children. This property is only applicable for auto-layout frames.
    #[serde(rename = "paddingLeft", skip_serializing_if = "Option::is_none")]
    pub padding_left: Option<f64>,
    /// The padding between the right border of the frame and its children. This property is only applicable for auto-layout frames.
    #[serde(rename = "paddingRight", skip_serializing_if = "Option::is_none")]
    pub padding_right: Option<f64>,
    /// The padding between the top border of the frame and its children. This property is only applicable for auto-layout frames.
    #[serde(rename = "paddingTop", skip_serializing_if = "Option::is_none")]
    pub padding_top: Option<f64>,
    /// The padding between the bottom border of the frame and its children. This property is only applicable for auto-layout frames.
    #[serde(rename = "paddingBottom", skip_serializing_if = "Option::is_none")]
    pub padding_bottom: Option<f64>,
    /// The distance between children of the frame. Can be negative. This property is only applicable for auto-layout frames.
    #[serde(rename = "itemSpacing", skip_serializing_if = "Option::is_none")]
    pub item_spacing: Option<f64>,
    /// Determines the canvas stacking order of layers in this frame. When true, the first layer will be draw on top. This property is only applicable for auto-layout frames.
    #[serde(rename = "itemReverseZIndex", skip_serializing_if = "Option::is_none")]
    pub item_reverse_z_index: Option<bool>,
    /// Determines whether strokes are included in layout calculations. When true, auto-layout frames behave like css \"box-sizing: border-box\". This property is only applicable for auto-layout frames.
    #[serde(rename = "strokesIncludedInLayout", skip_serializing_if = "Option::is_none")]
    pub strokes_included_in_layout: Option<bool>,
    /// Whether this auto-layout frame has wrapping enabled.
    #[serde(rename = "layoutWrap", skip_serializing_if = "Option::is_none")]
    pub layout_wrap: Option<LayoutWrap>,
    /// The distance between wrapped tracks of an auto-layout frame. This property is only applicable for auto-layout frames with `layoutWrap: \"WRAP\"`
    #[serde(rename = "counterAxisSpacing", skip_serializing_if = "Option::is_none")]
    pub counter_axis_spacing: Option<f64>,
    /// Determines how the auto-layout frame’s wrapped tracks should be aligned in the counter axis direction. This property is only applicable for auto-layout frames with `layoutWrap: \"WRAP\"`.
    #[serde(rename = "counterAxisAlignContent", skip_serializing_if = "Option::is_none")]
    pub counter_axis_align_content: Option<CounterAxisAlignContent>,
}

impl HasFramePropertiesTrait {
    pub fn new(clips_content: bool) -> HasFramePropertiesTrait {
        HasFramePropertiesTrait {
            clips_content,
            background: None,
            background_color: None,
            layout_grids: None,
            overflow_direction: None,
            layout_mode: None,
            primary_axis_sizing_mode: None,
            counter_axis_sizing_mode: None,
            primary_axis_align_items: None,
            counter_axis_align_items: None,
            padding_left: None,
            padding_right: None,
            padding_top: None,
            padding_bottom: None,
            item_spacing: None,
            item_reverse_z_index: None,
            strokes_included_in_layout: None,
            layout_wrap: None,
            counter_axis_spacing: None,
            counter_axis_align_content: None,
        }
    }
}
/// Whether a node has primary axis scrolling, horizontal or vertical.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OverflowDirection {
    #[serde(rename = "HORIZONTAL_SCROLLING")]
    HorizontalScrolling,
    #[serde(rename = "VERTICAL_SCROLLING")]
    VerticalScrolling,
    #[serde(rename = "HORIZONTAL_AND_VERTICAL_SCROLLING")]
    HorizontalAndVerticalScrolling,
    #[serde(rename = "NONE")]
    None,
}

impl Default for OverflowDirection {
    fn default() -> OverflowDirection {
        Self::HorizontalScrolling
    }
}
/// Whether this layer uses auto-layout to position its children.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LayoutMode {
    #[serde(rename = "NONE")]
    None,
    #[serde(rename = "HORIZONTAL")]
    Horizontal,
    #[serde(rename = "VERTICAL")]
    Vertical,
}

impl Default for LayoutMode {
    fn default() -> LayoutMode {
        Self::None
    }
}
/// Whether the primary axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PrimaryAxisSizingMode {
    #[serde(rename = "FIXED")]
    Fixed,
    #[serde(rename = "AUTO")]
    Auto,
}

impl Default for PrimaryAxisSizingMode {
    fn default() -> PrimaryAxisSizingMode {
        Self::Fixed
    }
}
/// Whether the counter axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CounterAxisSizingMode {
    #[serde(rename = "FIXED")]
    Fixed,
    #[serde(rename = "AUTO")]
    Auto,
}

impl Default for CounterAxisSizingMode {
    fn default() -> CounterAxisSizingMode {
        Self::Fixed
    }
}
/// Determines how the auto-layout frame's children should be aligned in the primary axis direction. This property is only applicable for auto-layout frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PrimaryAxisAlignItems {
    #[serde(rename = "MIN")]
    Min,
    #[serde(rename = "CENTER")]
    Center,
    #[serde(rename = "MAX")]
    Max,
    #[serde(rename = "SPACE_BETWEEN")]
    SpaceBetween,
}

impl Default for PrimaryAxisAlignItems {
    fn default() -> PrimaryAxisAlignItems {
        Self::Min
    }
}
/// Determines how the auto-layout frame's children should be aligned in the counter axis direction. This property is only applicable for auto-layout frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CounterAxisAlignItems {
    #[serde(rename = "MIN")]
    Min,
    #[serde(rename = "CENTER")]
    Center,
    #[serde(rename = "MAX")]
    Max,
    #[serde(rename = "BASELINE")]
    Baseline,
}

impl Default for CounterAxisAlignItems {
    fn default() -> CounterAxisAlignItems {
        Self::Min
    }
}
/// Whether this auto-layout frame has wrapping enabled.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LayoutWrap {
    #[serde(rename = "NO_WRAP")]
    NoWrap,
    #[serde(rename = "WRAP")]
    Wrap,
}

impl Default for LayoutWrap {
    fn default() -> LayoutWrap {
        Self::NoWrap
    }
}
/// Determines how the auto-layout frame’s wrapped tracks should be aligned in the counter axis direction. This property is only applicable for auto-layout frames with `layoutWrap: \"WRAP\"`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CounterAxisAlignContent {
    #[serde(rename = "AUTO")]
    Auto,
    #[serde(rename = "SPACE_BETWEEN")]
    SpaceBetween,
}

impl Default for CounterAxisAlignContent {
    fn default() -> CounterAxisAlignContent {
        Self::Auto
    }
}