/*
* 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 GroupNode {
/// A string uniquely identifying this node within the document.
#[serde(rename = "id")]
pub id: String,
/// The name given to the node by the user in the tool.
#[serde(rename = "name")]
pub name: String,
/// Whether or not the node is visible on the canvas.
#[serde(rename = "visible", skip_serializing_if = "Option::is_none")]
pub visible: Option<bool>,
/// If true, layer is locked and cannot be edited
#[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
pub locked: Option<bool>,
/// Whether the layer is fixed while the parent is scrolling
#[serde(rename = "isFixed", skip_serializing_if = "Option::is_none")]
pub is_fixed: Option<bool>,
/// How layer should be treated when the frame is resized
#[serde(rename = "scrollBehavior")]
pub scroll_behavior: ScrollBehavior,
/// The rotation of the node, if not 0.
#[serde(rename = "rotation", skip_serializing_if = "Option::is_none")]
pub rotation: Option<f64>,
/// A mapping of a layer's property to component property name of component properties attached to this node. The component property name can be used to look up more information on the corresponding component's or component set's componentPropertyDefinitions.
#[serde(rename = "componentPropertyReferences", skip_serializing_if = "Option::is_none")]
pub component_property_references: Option<std::collections::HashMap<String, String>>,
#[serde(rename = "pluginData", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub plugin_data: Option<Option<serde_json::Value>>,
#[serde(rename = "sharedPluginData", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub shared_plugin_data: Option<Option<serde_json::Value>>,
#[serde(rename = "boundVariables", skip_serializing_if = "Option::is_none")]
pub bound_variables: Option<Box<models::IsLayerTraitBoundVariables>>,
/// A mapping of variable collection ID to mode ID representing the explicitly set modes for this node.
#[serde(rename = "explicitVariableModes", skip_serializing_if = "Option::is_none")]
pub explicit_variable_modes: Option<std::collections::HashMap<String, String>>,
/// How this node blends with nodes behind it in the scene (see blend mode section for more details)
#[serde(rename = "blendMode")]
pub blend_mode: models::BlendMode,
/// Opacity of the node
#[serde(rename = "opacity", skip_serializing_if = "Option::is_none")]
pub opacity: Option<f64>,
/// An array of nodes that are direct children of this node
#[serde(rename = "children")]
pub children: Vec<models::SubcanvasNode>,
/// Keep height and width constrained to same ratio.
#[serde(rename = "preserveRatio", skip_serializing_if = "Option::is_none")]
pub preserve_ratio: Option<bool>,
/// Horizontal and vertical layout constraints for node.
#[serde(rename = "constraints", skip_serializing_if = "Option::is_none")]
pub constraints: Option<Box<models::LayoutConstraint>>,
/// A transformation matrix is standard way in computer graphics to represent translation and rotation. These are the top two rows of a 3x3 matrix. The bottom row of the matrix is assumed to be [0, 0, 1]. This is known as an affine transform and is enough to represent translation, rotation, and skew. The identity transform is [[1, 0, 0], [0, 1, 0]]. A translation matrix will typically look like: ``` [[1, 0, tx], [0, 1, ty]] ``` and a rotation matrix will typically look like: ``` [[cos(angle), sin(angle), 0], [-sin(angle), cos(angle), 0]] ``` Another way to think about this transform is as three vectors: - The x axis (t[0][0], t[1][0]) - The y axis (t[0][1], t[1][1]) - The translation offset (t[0][2], t[1][2]) The most common usage of the Transform matrix is the `relativeTransform property`. This particular usage of the matrix has a few additional restrictions. The translation offset can take on any value but we do enforce that the axis vectors are unit vectors (i.e. have length 1). The axes are not required to be at 90° angles to each other.
#[serde(rename = "relativeTransform", skip_serializing_if = "Option::is_none")]
pub relative_transform: Option<Vec<Vec<f64>>>,
/// Width and height of element. This is different from the width and height of the bounding box in that the absolute bounding box represents the element after scaling and rotation. Only present if `geometry=paths` is passed.
#[serde(rename = "size", skip_serializing_if = "Option::is_none")]
pub size: Option<Box<models::Vector>>,
/// Determines if the layer should stretch along the parent's counter axis. This property is only provided for direct children of auto-layout frames. - `INHERIT` - `STRETCH` In previous versions of auto layout, determined how the layer is aligned inside an auto-layout frame. This property is only provided for direct children of auto-layout frames. - `MIN` - `CENTER` - `MAX` - `STRETCH` In horizontal auto-layout frames, \"MIN\" and \"MAX\" correspond to \"TOP\" and \"BOTTOM\". In vertical auto-layout frames, \"MIN\" and \"MAX\" correspond to \"LEFT\" and \"RIGHT\".
#[serde(rename = "layoutAlign", skip_serializing_if = "Option::is_none")]
pub layout_align: Option<LayoutAlign>,
/// This property is applicable only for direct children of auto-layout frames, ignored otherwise. Determines whether a layer should stretch along the parent's primary axis. A `0` corresponds to a fixed size and `1` corresponds to stretch.
#[serde(rename = "layoutGrow", skip_serializing_if = "Option::is_none")]
pub layout_grow: Option<f64>,
/// Determines whether a layer's size and position should be determined by auto-layout settings or manually adjustable.
#[serde(rename = "layoutPositioning", skip_serializing_if = "Option::is_none")]
pub layout_positioning: Option<LayoutPositioning>,
/// The minimum width of the frame. This property is only applicable for auto-layout frames or direct children of auto-layout frames.
#[serde(rename = "minWidth", skip_serializing_if = "Option::is_none")]
pub min_width: Option<f64>,
/// The maximum width of the frame. This property is only applicable for auto-layout frames or direct children of auto-layout frames.
#[serde(rename = "maxWidth", skip_serializing_if = "Option::is_none")]
pub max_width: Option<f64>,
/// The minimum height of the frame. This property is only applicable for auto-layout frames or direct children of auto-layout frames.
#[serde(rename = "minHeight", skip_serializing_if = "Option::is_none")]
pub min_height: Option<f64>,
/// The maximum height of the frame. This property is only applicable for auto-layout frames or direct children of auto-layout frames.
#[serde(rename = "maxHeight", skip_serializing_if = "Option::is_none")]
pub max_height: Option<f64>,
/// The horizontal sizing setting on this auto-layout frame or frame child. - `FIXED` - `HUG`: only valid on auto-layout frames and text nodes - `FILL`: only valid on auto-layout frame children
#[serde(rename = "layoutSizingHorizontal", skip_serializing_if = "Option::is_none")]
pub layout_sizing_horizontal: Option<LayoutSizingHorizontal>,
/// The vertical sizing setting on this auto-layout frame or frame child. - `FIXED` - `HUG`: only valid on auto-layout frames and text nodes - `FILL`: only valid on auto-layout frame children
#[serde(rename = "layoutSizingVertical", skip_serializing_if = "Option::is_none")]
pub layout_sizing_vertical: Option<LayoutSizingVertical>,
/// 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>,
/// Radius of each corner if a single radius is set for all corners
#[serde(rename = "cornerRadius", skip_serializing_if = "Option::is_none")]
pub corner_radius: Option<f64>,
/// A value that lets you control how \"smooth\" the corners are. Ranges from 0 to 1. 0 is the default and means that the corner is perfectly circular. A value of 0.6 means the corner matches the iOS 7 \"squircle\" icon shape. Other values produce various other curves.
#[serde(rename = "cornerSmoothing", skip_serializing_if = "Option::is_none")]
pub corner_smoothing: Option<f64>,
/// Array of length 4 of the radius of each corner of the frame, starting in the top left and proceeding clockwise. Values are given in the order top-left, top-right, bottom-right, bottom-left.
#[serde(rename = "rectangleCornerRadii", skip_serializing_if = "Option::is_none")]
pub rectangle_corner_radii: Option<Vec<f64>>,
/// An array of fill paints applied to the node.
#[serde(rename = "fills")]
pub fills: Vec<models::Paint>,
/// A mapping of a StyleType to style ID (see Style) of styles present on this node. The style ID can be used to look up more information about the style in the top-level styles field.
#[serde(rename = "styles", skip_serializing_if = "Option::is_none")]
pub styles: Option<std::collections::HashMap<String, String>>,
/// An array of stroke paints applied to the node.
#[serde(rename = "strokes", skip_serializing_if = "Option::is_none")]
pub strokes: Option<Vec<models::Paint>>,
/// The weight of strokes on the node.
#[serde(rename = "strokeWeight", skip_serializing_if = "Option::is_none")]
pub stroke_weight: Option<f64>,
/// Position of stroke relative to vector outline, as a string enum - `INSIDE`: stroke drawn inside the shape boundary - `OUTSIDE`: stroke drawn outside the shape boundary - `CENTER`: stroke drawn centered along the shape boundary
#[serde(rename = "strokeAlign", skip_serializing_if = "Option::is_none")]
pub stroke_align: Option<StrokeAlign>,
/// A string enum with value of \"MITER\", \"BEVEL\", or \"ROUND\", describing how corners in vector paths are rendered.
#[serde(rename = "strokeJoin", skip_serializing_if = "Option::is_none")]
pub stroke_join: Option<StrokeJoin>,
/// An array of floating point numbers describing the pattern of dash length and gap lengths that the vector stroke will use when drawn. For example a value of [1, 2] indicates that the stroke will be drawn with a dash of length 1 followed by a gap of length 2, repeated.
#[serde(rename = "strokeDashes", skip_serializing_if = "Option::is_none")]
pub stroke_dashes: Option<Vec<f64>>,
/// Only specified if parameter `geometry=paths` is used. An array of paths representing the object fill.
#[serde(rename = "fillGeometry", skip_serializing_if = "Option::is_none")]
pub fill_geometry: Option<Vec<models::Path>>,
/// Only specified if parameter `geometry=paths` is used. An array of paths representing the object stroke.
#[serde(rename = "strokeGeometry", skip_serializing_if = "Option::is_none")]
pub stroke_geometry: Option<Vec<models::Path>>,
/// A string enum describing the end caps of vector paths.
#[serde(rename = "strokeCap", skip_serializing_if = "Option::is_none")]
pub stroke_cap: Option<StrokeCap>,
/// Only valid if `strokeJoin` is \"MITER\". The corner angle, in degrees, below which `strokeJoin` will be set to \"BEVEL\" to avoid super sharp corners. By default this is 28.96 degrees.
#[serde(rename = "strokeMiterAngle", skip_serializing_if = "Option::is_none")]
pub stroke_miter_angle: Option<f64>,
/// An array of export settings representing images to export from the node.
#[serde(rename = "exportSettings", skip_serializing_if = "Option::is_none")]
pub export_settings: Option<Vec<models::ExportSetting>>,
/// An array of effects attached to this node (see effects section for more details)
#[serde(rename = "effects")]
pub effects: Vec<models::Effect>,
/// Does this node mask sibling nodes in front of it?
#[serde(rename = "isMask", skip_serializing_if = "Option::is_none")]
pub is_mask: Option<bool>,
/// If this layer is a mask, this property describes the operation used to mask the layer's siblings. The value may be one of the following: - ALPHA: the mask node's alpha channel will be used to determine the opacity of each pixel in the masked result. - VECTOR: if the mask node has visible fill paints, every pixel inside the node's fill regions will be fully visible in the masked result. If the mask has visible stroke paints, every pixel inside the node's stroke regions will be fully visible in the masked result. - LUMINANCE: the luminance value of each pixel of the mask node will be used to determine the opacity of that pixel in the masked result.
#[serde(rename = "maskType", skip_serializing_if = "Option::is_none")]
pub mask_type: Option<MaskType>,
/// True if maskType is VECTOR. This field is deprecated; use maskType instead.
#[serde(rename = "isMaskOutline", skip_serializing_if = "Option::is_none")]
pub is_mask_outline: Option<bool>,
/// Node ID of node to transition to in prototyping
#[serde(rename = "transitionNodeID", skip_serializing_if = "Option::is_none")]
pub transition_node_id: Option<String>,
/// The duration of the prototyping transition on this node (in milliseconds). This will override the default transition duration on the prototype, for this node.
#[serde(rename = "transitionDuration", skip_serializing_if = "Option::is_none")]
pub transition_duration: Option<f64>,
/// The easing curve used in the prototyping transition on this node.
#[serde(rename = "transitionEasing", skip_serializing_if = "Option::is_none")]
pub transition_easing: Option<models::EasingType>,
/// An object including the top, bottom, left, and right stroke weights. Only returned if individual stroke weights are used.
#[serde(rename = "individualStrokeWeights", skip_serializing_if = "Option::is_none")]
pub individual_stroke_weights: Option<Box<models::StrokeWeights>>,
}
impl GroupNode {
pub fn new(id: String, name: String, scroll_behavior: ScrollBehavior, blend_mode: models::BlendMode, children: Vec<models::SubcanvasNode>, clips_content: bool, fills: Vec<models::Paint>, effects: Vec<models::Effect>) -> GroupNode {
GroupNode {
id,
name,
visible: None,
locked: None,
is_fixed: None,
scroll_behavior,
rotation: None,
component_property_references: None,
plugin_data: None,
shared_plugin_data: None,
bound_variables: None,
explicit_variable_modes: None,
blend_mode,
opacity: None,
children,
preserve_ratio: None,
constraints: None,
relative_transform: None,
size: None,
layout_align: None,
layout_grow: None,
layout_positioning: None,
min_width: None,
max_width: None,
min_height: None,
max_height: None,
layout_sizing_horizontal: None,
layout_sizing_vertical: None,
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,
corner_radius: None,
corner_smoothing: None,
rectangle_corner_radii: None,
fills,
styles: None,
strokes: None,
stroke_weight: None,
stroke_align: None,
stroke_join: None,
stroke_dashes: None,
fill_geometry: None,
stroke_geometry: None,
stroke_cap: None,
stroke_miter_angle: None,
export_settings: None,
effects,
is_mask: None,
mask_type: None,
is_mask_outline: None,
transition_node_id: None,
transition_duration: None,
transition_easing: None,
individual_stroke_weights: None,
}
}
}
/// How layer should be treated when the frame is resized
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ScrollBehavior {
#[serde(rename = "SCROLLS")]
Scrolls,
#[serde(rename = "FIXED")]
Fixed,
#[serde(rename = "STICKY_SCROLLS")]
StickyScrolls,
}
impl Default for ScrollBehavior {
fn default() -> ScrollBehavior {
Self::Scrolls
}
}
/// Determines if the layer should stretch along the parent's counter axis. This property is only provided for direct children of auto-layout frames. - `INHERIT` - `STRETCH` In previous versions of auto layout, determined how the layer is aligned inside an auto-layout frame. This property is only provided for direct children of auto-layout frames. - `MIN` - `CENTER` - `MAX` - `STRETCH` In horizontal auto-layout frames, \"MIN\" and \"MAX\" correspond to \"TOP\" and \"BOTTOM\". In vertical auto-layout frames, \"MIN\" and \"MAX\" correspond to \"LEFT\" and \"RIGHT\".
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LayoutAlign {
#[serde(rename = "INHERIT")]
Inherit,
#[serde(rename = "STRETCH")]
Stretch,
#[serde(rename = "MIN")]
Min,
#[serde(rename = "CENTER")]
Center,
#[serde(rename = "MAX")]
Max,
}
impl Default for LayoutAlign {
fn default() -> LayoutAlign {
Self::Inherit
}
}
/// Determines whether a layer's size and position should be determined by auto-layout settings or manually adjustable.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LayoutPositioning {
#[serde(rename = "AUTO")]
Auto,
#[serde(rename = "ABSOLUTE")]
Absolute,
}
impl Default for LayoutPositioning {
fn default() -> LayoutPositioning {
Self::Auto
}
}
/// The horizontal sizing setting on this auto-layout frame or frame child. - `FIXED` - `HUG`: only valid on auto-layout frames and text nodes - `FILL`: only valid on auto-layout frame children
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LayoutSizingHorizontal {
#[serde(rename = "FIXED")]
Fixed,
#[serde(rename = "HUG")]
Hug,
#[serde(rename = "FILL")]
Fill,
}
impl Default for LayoutSizingHorizontal {
fn default() -> LayoutSizingHorizontal {
Self::Fixed
}
}
/// The vertical sizing setting on this auto-layout frame or frame child. - `FIXED` - `HUG`: only valid on auto-layout frames and text nodes - `FILL`: only valid on auto-layout frame children
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LayoutSizingVertical {
#[serde(rename = "FIXED")]
Fixed,
#[serde(rename = "HUG")]
Hug,
#[serde(rename = "FILL")]
Fill,
}
impl Default for LayoutSizingVertical {
fn default() -> LayoutSizingVertical {
Self::Fixed
}
}
/// 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
}
}
/// Position of stroke relative to vector outline, as a string enum - `INSIDE`: stroke drawn inside the shape boundary - `OUTSIDE`: stroke drawn outside the shape boundary - `CENTER`: stroke drawn centered along the shape boundary
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StrokeAlign {
#[serde(rename = "INSIDE")]
Inside,
#[serde(rename = "OUTSIDE")]
Outside,
#[serde(rename = "CENTER")]
Center,
}
impl Default for StrokeAlign {
fn default() -> StrokeAlign {
Self::Inside
}
}
/// A string enum with value of \"MITER\", \"BEVEL\", or \"ROUND\", describing how corners in vector paths are rendered.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StrokeJoin {
#[serde(rename = "MITER")]
Miter,
#[serde(rename = "BEVEL")]
Bevel,
#[serde(rename = "ROUND")]
Round,
}
impl Default for StrokeJoin {
fn default() -> StrokeJoin {
Self::Miter
}
}
/// A string enum describing the end caps of vector paths.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StrokeCap {
#[serde(rename = "NONE")]
None,
#[serde(rename = "ROUND")]
Round,
#[serde(rename = "SQUARE")]
Square,
#[serde(rename = "LINE_ARROW")]
LineArrow,
#[serde(rename = "TRIANGLE_ARROW")]
TriangleArrow,
#[serde(rename = "DIAMOND_FILLED")]
DiamondFilled,
#[serde(rename = "CIRCLE_FILLED")]
CircleFilled,
#[serde(rename = "TRIANGLE_FILLED")]
TriangleFilled,
#[serde(rename = "WASHI_TAPE_1")]
WashiTape1,
#[serde(rename = "WASHI_TAPE_2")]
WashiTape2,
#[serde(rename = "WASHI_TAPE_3")]
WashiTape3,
#[serde(rename = "WASHI_TAPE_4")]
WashiTape4,
#[serde(rename = "WASHI_TAPE_5")]
WashiTape5,
#[serde(rename = "WASHI_TAPE_6")]
WashiTape6,
}
impl Default for StrokeCap {
fn default() -> StrokeCap {
Self::None
}
}
/// If this layer is a mask, this property describes the operation used to mask the layer's siblings. The value may be one of the following: - ALPHA: the mask node's alpha channel will be used to determine the opacity of each pixel in the masked result. - VECTOR: if the mask node has visible fill paints, every pixel inside the node's fill regions will be fully visible in the masked result. If the mask has visible stroke paints, every pixel inside the node's stroke regions will be fully visible in the masked result. - LUMINANCE: the luminance value of each pixel of the mask node will be used to determine the opacity of that pixel in the masked result.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MaskType {
#[serde(rename = "ALPHA")]
Alpha,
#[serde(rename = "VECTOR")]
Vector,
#[serde(rename = "LUMINANCE")]
Luminance,
}
impl Default for MaskType {
fn default() -> MaskType {
Self::Alpha
}
}