figma_api/models/
instance_node.rs

1/*
2 * Figma API
3 *
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).
5 *
6 * The version of the OpenAPI document: 0.31.0
7 * Contact: support@figma.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct InstanceNode {
16    /// A string uniquely identifying this node within the document.
17    #[serde(rename = "id")]
18    pub id: String,
19    /// The name given to the node by the user in the tool.
20    #[serde(rename = "name")]
21    pub name: String,
22    /// Whether or not the node is visible on the canvas.
23    #[serde(rename = "visible", skip_serializing_if = "Option::is_none")]
24    pub visible: Option<bool>,
25    /// If true, layer is locked and cannot be edited
26    #[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
27    pub locked: Option<bool>,
28    /// Whether the layer is fixed while the parent is scrolling
29    #[serde(rename = "isFixed", skip_serializing_if = "Option::is_none")]
30    pub is_fixed: Option<bool>,
31    /// How layer should be treated when the frame is resized
32    #[serde(rename = "scrollBehavior")]
33    pub scroll_behavior: ScrollBehavior,
34    /// The rotation of the node, if not 0.
35    #[serde(rename = "rotation", skip_serializing_if = "Option::is_none")]
36    pub rotation: Option<f64>,
37    /// 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.
38    #[serde(rename = "componentPropertyReferences", skip_serializing_if = "Option::is_none")]
39    pub component_property_references: Option<std::collections::HashMap<String, String>>,
40    #[serde(rename = "pluginData", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub plugin_data: Option<Option<serde_json::Value>>,
42    #[serde(rename = "sharedPluginData", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub shared_plugin_data: Option<Option<serde_json::Value>>,
44    #[serde(rename = "boundVariables", skip_serializing_if = "Option::is_none")]
45    pub bound_variables: Option<Box<models::IsLayerTraitBoundVariables>>,
46    /// A mapping of variable collection ID to mode ID representing the explicitly set modes for this node.
47    #[serde(rename = "explicitVariableModes", skip_serializing_if = "Option::is_none")]
48    pub explicit_variable_modes: Option<std::collections::HashMap<String, String>>,
49    /// How this node blends with nodes behind it in the scene (see blend mode section for more details)
50    #[serde(rename = "blendMode")]
51    pub blend_mode: models::BlendMode,
52    /// Opacity of the node
53    #[serde(rename = "opacity", skip_serializing_if = "Option::is_none")]
54    pub opacity: Option<f64>,
55    /// An array of nodes that are direct children of this node
56    #[serde(rename = "children")]
57    pub children: Vec<models::SubcanvasNode>,
58    /// Keep height and width constrained to same ratio.
59    #[serde(rename = "preserveRatio", skip_serializing_if = "Option::is_none")]
60    pub preserve_ratio: Option<bool>,
61    /// Horizontal and vertical layout constraints for node.
62    #[serde(rename = "constraints", skip_serializing_if = "Option::is_none")]
63    pub constraints: Option<Box<models::LayoutConstraint>>,
64    /// 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.
65    #[serde(rename = "relativeTransform", skip_serializing_if = "Option::is_none")]
66    pub relative_transform: Option<Vec<Vec<f64>>>,
67    /// 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.
68    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
69    pub size: Option<Box<models::Vector>>,
70    ///  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\".
71    #[serde(rename = "layoutAlign", skip_serializing_if = "Option::is_none")]
72    pub layout_align: Option<LayoutAlign>,
73    /// 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.
74    #[serde(rename = "layoutGrow", skip_serializing_if = "Option::is_none")]
75    pub layout_grow: Option<f64>,
76    /// Determines whether a layer's size and position should be determined by auto-layout settings or manually adjustable.
77    #[serde(rename = "layoutPositioning", skip_serializing_if = "Option::is_none")]
78    pub layout_positioning: Option<LayoutPositioning>,
79    /// The minimum width of the frame. This property is only applicable for auto-layout frames or direct children of auto-layout frames.
80    #[serde(rename = "minWidth", skip_serializing_if = "Option::is_none")]
81    pub min_width: Option<f64>,
82    /// The maximum width of the frame. This property is only applicable for auto-layout frames or direct children of auto-layout frames.
83    #[serde(rename = "maxWidth", skip_serializing_if = "Option::is_none")]
84    pub max_width: Option<f64>,
85    /// The minimum height of the frame. This property is only applicable for auto-layout frames or direct children of auto-layout frames.
86    #[serde(rename = "minHeight", skip_serializing_if = "Option::is_none")]
87    pub min_height: Option<f64>,
88    /// The maximum height of the frame. This property is only applicable for auto-layout frames or direct children of auto-layout frames.
89    #[serde(rename = "maxHeight", skip_serializing_if = "Option::is_none")]
90    pub max_height: Option<f64>,
91    /// 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
92    #[serde(rename = "layoutSizingHorizontal", skip_serializing_if = "Option::is_none")]
93    pub layout_sizing_horizontal: Option<LayoutSizingHorizontal>,
94    /// 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
95    #[serde(rename = "layoutSizingVertical", skip_serializing_if = "Option::is_none")]
96    pub layout_sizing_vertical: Option<LayoutSizingVertical>,
97    /// Whether or not this node clip content outside of its bounds
98    #[serde(rename = "clipsContent")]
99    pub clips_content: bool,
100    /// Background of the node. This is deprecated, as backgrounds for frames are now in the `fills` field.
101    #[serde(rename = "background", skip_serializing_if = "Option::is_none")]
102    pub background: Option<Vec<models::Paint>>,
103    /// 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.
104    #[serde(rename = "backgroundColor", skip_serializing_if = "Option::is_none")]
105    pub background_color: Option<Box<models::Rgba>>,
106    /// An array of layout grids attached to this node (see layout grids section for more details). GROUP nodes do not have this attribute
107    #[serde(rename = "layoutGrids", skip_serializing_if = "Option::is_none")]
108    pub layout_grids: Option<Vec<models::LayoutGrid>>,
109    /// Whether a node has primary axis scrolling, horizontal or vertical.
110    #[serde(rename = "overflowDirection", skip_serializing_if = "Option::is_none")]
111    pub overflow_direction: Option<OverflowDirection>,
112    /// Whether this layer uses auto-layout to position its children.
113    #[serde(rename = "layoutMode", skip_serializing_if = "Option::is_none")]
114    pub layout_mode: Option<LayoutMode>,
115    /// 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.
116    #[serde(rename = "primaryAxisSizingMode", skip_serializing_if = "Option::is_none")]
117    pub primary_axis_sizing_mode: Option<PrimaryAxisSizingMode>,
118    /// 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.
119    #[serde(rename = "counterAxisSizingMode", skip_serializing_if = "Option::is_none")]
120    pub counter_axis_sizing_mode: Option<CounterAxisSizingMode>,
121    /// 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.
122    #[serde(rename = "primaryAxisAlignItems", skip_serializing_if = "Option::is_none")]
123    pub primary_axis_align_items: Option<PrimaryAxisAlignItems>,
124    /// 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.
125    #[serde(rename = "counterAxisAlignItems", skip_serializing_if = "Option::is_none")]
126    pub counter_axis_align_items: Option<CounterAxisAlignItems>,
127    /// The padding between the left border of the frame and its children. This property is only applicable for auto-layout frames.
128    #[serde(rename = "paddingLeft", skip_serializing_if = "Option::is_none")]
129    pub padding_left: Option<f64>,
130    /// The padding between the right border of the frame and its children. This property is only applicable for auto-layout frames.
131    #[serde(rename = "paddingRight", skip_serializing_if = "Option::is_none")]
132    pub padding_right: Option<f64>,
133    /// The padding between the top border of the frame and its children. This property is only applicable for auto-layout frames.
134    #[serde(rename = "paddingTop", skip_serializing_if = "Option::is_none")]
135    pub padding_top: Option<f64>,
136    /// The padding between the bottom border of the frame and its children. This property is only applicable for auto-layout frames.
137    #[serde(rename = "paddingBottom", skip_serializing_if = "Option::is_none")]
138    pub padding_bottom: Option<f64>,
139    /// The distance between children of the frame. Can be negative. This property is only applicable for auto-layout frames.
140    #[serde(rename = "itemSpacing", skip_serializing_if = "Option::is_none")]
141    pub item_spacing: Option<f64>,
142    /// 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.
143    #[serde(rename = "itemReverseZIndex", skip_serializing_if = "Option::is_none")]
144    pub item_reverse_z_index: Option<bool>,
145    /// 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.
146    #[serde(rename = "strokesIncludedInLayout", skip_serializing_if = "Option::is_none")]
147    pub strokes_included_in_layout: Option<bool>,
148    /// Whether this auto-layout frame has wrapping enabled.
149    #[serde(rename = "layoutWrap", skip_serializing_if = "Option::is_none")]
150    pub layout_wrap: Option<LayoutWrap>,
151    /// The distance between wrapped tracks of an auto-layout frame. This property is only applicable for auto-layout frames with `layoutWrap: \"WRAP\"`
152    #[serde(rename = "counterAxisSpacing", skip_serializing_if = "Option::is_none")]
153    pub counter_axis_spacing: Option<f64>,
154    /// 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\"`.
155    #[serde(rename = "counterAxisAlignContent", skip_serializing_if = "Option::is_none")]
156    pub counter_axis_align_content: Option<CounterAxisAlignContent>,
157    /// Radius of each corner if a single radius is set for all corners
158    #[serde(rename = "cornerRadius", skip_serializing_if = "Option::is_none")]
159    pub corner_radius: Option<f64>,
160    /// 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.
161    #[serde(rename = "cornerSmoothing", skip_serializing_if = "Option::is_none")]
162    pub corner_smoothing: Option<f64>,
163    /// 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.
164    #[serde(rename = "rectangleCornerRadii", skip_serializing_if = "Option::is_none")]
165    pub rectangle_corner_radii: Option<Vec<f64>>,
166    /// An array of fill paints applied to the node.
167    #[serde(rename = "fills")]
168    pub fills: Vec<models::Paint>,
169    /// 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.
170    #[serde(rename = "styles", skip_serializing_if = "Option::is_none")]
171    pub styles: Option<std::collections::HashMap<String, String>>,
172    /// An array of stroke paints applied to the node.
173    #[serde(rename = "strokes", skip_serializing_if = "Option::is_none")]
174    pub strokes: Option<Vec<models::Paint>>,
175    /// The weight of strokes on the node.
176    #[serde(rename = "strokeWeight", skip_serializing_if = "Option::is_none")]
177    pub stroke_weight: Option<f64>,
178    /// 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
179    #[serde(rename = "strokeAlign", skip_serializing_if = "Option::is_none")]
180    pub stroke_align: Option<StrokeAlign>,
181    /// A string enum with value of \"MITER\", \"BEVEL\", or \"ROUND\", describing how corners in vector paths are rendered.
182    #[serde(rename = "strokeJoin", skip_serializing_if = "Option::is_none")]
183    pub stroke_join: Option<StrokeJoin>,
184    /// 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.
185    #[serde(rename = "strokeDashes", skip_serializing_if = "Option::is_none")]
186    pub stroke_dashes: Option<Vec<f64>>,
187    /// Only specified if parameter `geometry=paths` is used. An array of paths representing the object fill.
188    #[serde(rename = "fillGeometry", skip_serializing_if = "Option::is_none")]
189    pub fill_geometry: Option<Vec<models::Path>>,
190    /// Only specified if parameter `geometry=paths` is used. An array of paths representing the object stroke.
191    #[serde(rename = "strokeGeometry", skip_serializing_if = "Option::is_none")]
192    pub stroke_geometry: Option<Vec<models::Path>>,
193    /// A string enum describing the end caps of vector paths.
194    #[serde(rename = "strokeCap", skip_serializing_if = "Option::is_none")]
195    pub stroke_cap: Option<StrokeCap>,
196    /// 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.
197    #[serde(rename = "strokeMiterAngle", skip_serializing_if = "Option::is_none")]
198    pub stroke_miter_angle: Option<f64>,
199    /// An array of export settings representing images to export from the node.
200    #[serde(rename = "exportSettings", skip_serializing_if = "Option::is_none")]
201    pub export_settings: Option<Vec<models::ExportSetting>>,
202    /// An array of effects attached to this node (see effects section for more details)
203    #[serde(rename = "effects")]
204    pub effects: Vec<models::Effect>,
205    /// Does this node mask sibling nodes in front of it?
206    #[serde(rename = "isMask", skip_serializing_if = "Option::is_none")]
207    pub is_mask: Option<bool>,
208    /// 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.
209    #[serde(rename = "maskType", skip_serializing_if = "Option::is_none")]
210    pub mask_type: Option<MaskType>,
211    /// True if maskType is VECTOR. This field is deprecated; use maskType instead.
212    #[serde(rename = "isMaskOutline", skip_serializing_if = "Option::is_none")]
213    pub is_mask_outline: Option<bool>,
214    /// Node ID of node to transition to in prototyping
215    #[serde(rename = "transitionNodeID", skip_serializing_if = "Option::is_none")]
216    pub transition_node_id: Option<String>,
217    /// The duration of the prototyping transition on this node (in milliseconds). This will override the default transition duration on the prototype, for this node.
218    #[serde(rename = "transitionDuration", skip_serializing_if = "Option::is_none")]
219    pub transition_duration: Option<f64>,
220    /// The easing curve used in the prototyping transition on this node.
221    #[serde(rename = "transitionEasing", skip_serializing_if = "Option::is_none")]
222    pub transition_easing: Option<models::EasingType>,
223    /// An object including the top, bottom, left, and right stroke weights. Only returned if individual stroke weights are used.
224    #[serde(rename = "individualStrokeWeights", skip_serializing_if = "Option::is_none")]
225    pub individual_stroke_weights: Option<Box<models::StrokeWeights>>,
226    /// ID of component that this instance came from.
227    #[serde(rename = "componentId")]
228    pub component_id: String,
229    /// If true, this node has been marked as exposed to its containing component or component set.
230    #[serde(rename = "isExposedInstance", skip_serializing_if = "Option::is_none")]
231    pub is_exposed_instance: Option<bool>,
232    /// IDs of instances that have been exposed to this node's level.
233    #[serde(rename = "exposedInstances", skip_serializing_if = "Option::is_none")]
234    pub exposed_instances: Option<Vec<String>>,
235    /// A mapping of name to `ComponentProperty` for all component properties on this instance. Each property has a type, value, and other optional values.
236    #[serde(rename = "componentProperties", skip_serializing_if = "Option::is_none")]
237    pub component_properties: Option<std::collections::HashMap<String, models::ComponentProperty>>,
238    /// An array of all of the fields directly overridden on this instance. Inherited overrides are not included.
239    #[serde(rename = "overrides")]
240    pub overrides: Vec<models::Overrides>,
241}
242
243impl InstanceNode {
244    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>, component_id: String, overrides: Vec<models::Overrides>) -> InstanceNode {
245        InstanceNode {
246            id,
247            name,
248            visible: None,
249            locked: None,
250            is_fixed: None,
251            scroll_behavior,
252            rotation: None,
253            component_property_references: None,
254            plugin_data: None,
255            shared_plugin_data: None,
256            bound_variables: None,
257            explicit_variable_modes: None,
258            blend_mode,
259            opacity: None,
260            children,
261            preserve_ratio: None,
262            constraints: None,
263            relative_transform: None,
264            size: None,
265            layout_align: None,
266            layout_grow: None,
267            layout_positioning: None,
268            min_width: None,
269            max_width: None,
270            min_height: None,
271            max_height: None,
272            layout_sizing_horizontal: None,
273            layout_sizing_vertical: None,
274            clips_content,
275            background: None,
276            background_color: None,
277            layout_grids: None,
278            overflow_direction: None,
279            layout_mode: None,
280            primary_axis_sizing_mode: None,
281            counter_axis_sizing_mode: None,
282            primary_axis_align_items: None,
283            counter_axis_align_items: None,
284            padding_left: None,
285            padding_right: None,
286            padding_top: None,
287            padding_bottom: None,
288            item_spacing: None,
289            item_reverse_z_index: None,
290            strokes_included_in_layout: None,
291            layout_wrap: None,
292            counter_axis_spacing: None,
293            counter_axis_align_content: None,
294            corner_radius: None,
295            corner_smoothing: None,
296            rectangle_corner_radii: None,
297            fills,
298            styles: None,
299            strokes: None,
300            stroke_weight: None,
301            stroke_align: None,
302            stroke_join: None,
303            stroke_dashes: None,
304            fill_geometry: None,
305            stroke_geometry: None,
306            stroke_cap: None,
307            stroke_miter_angle: None,
308            export_settings: None,
309            effects,
310            is_mask: None,
311            mask_type: None,
312            is_mask_outline: None,
313            transition_node_id: None,
314            transition_duration: None,
315            transition_easing: None,
316            individual_stroke_weights: None,
317            component_id,
318            is_exposed_instance: None,
319            exposed_instances: None,
320            component_properties: None,
321            overrides,
322        }
323    }
324}
325/// How layer should be treated when the frame is resized
326#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
327pub enum ScrollBehavior {
328    #[serde(rename = "SCROLLS")]
329    Scrolls,
330    #[serde(rename = "FIXED")]
331    Fixed,
332    #[serde(rename = "STICKY_SCROLLS")]
333    StickyScrolls,
334}
335
336impl Default for ScrollBehavior {
337    fn default() -> ScrollBehavior {
338        Self::Scrolls
339    }
340}
341///  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\".
342#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
343pub enum LayoutAlign {
344    #[serde(rename = "INHERIT")]
345    Inherit,
346    #[serde(rename = "STRETCH")]
347    Stretch,
348    #[serde(rename = "MIN")]
349    Min,
350    #[serde(rename = "CENTER")]
351    Center,
352    #[serde(rename = "MAX")]
353    Max,
354}
355
356impl Default for LayoutAlign {
357    fn default() -> LayoutAlign {
358        Self::Inherit
359    }
360}
361/// Determines whether a layer's size and position should be determined by auto-layout settings or manually adjustable.
362#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
363pub enum LayoutPositioning {
364    #[serde(rename = "AUTO")]
365    Auto,
366    #[serde(rename = "ABSOLUTE")]
367    Absolute,
368}
369
370impl Default for LayoutPositioning {
371    fn default() -> LayoutPositioning {
372        Self::Auto
373    }
374}
375/// 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
376#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
377pub enum LayoutSizingHorizontal {
378    #[serde(rename = "FIXED")]
379    Fixed,
380    #[serde(rename = "HUG")]
381    Hug,
382    #[serde(rename = "FILL")]
383    Fill,
384}
385
386impl Default for LayoutSizingHorizontal {
387    fn default() -> LayoutSizingHorizontal {
388        Self::Fixed
389    }
390}
391/// 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
392#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
393pub enum LayoutSizingVertical {
394    #[serde(rename = "FIXED")]
395    Fixed,
396    #[serde(rename = "HUG")]
397    Hug,
398    #[serde(rename = "FILL")]
399    Fill,
400}
401
402impl Default for LayoutSizingVertical {
403    fn default() -> LayoutSizingVertical {
404        Self::Fixed
405    }
406}
407/// Whether a node has primary axis scrolling, horizontal or vertical.
408#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
409pub enum OverflowDirection {
410    #[serde(rename = "HORIZONTAL_SCROLLING")]
411    HorizontalScrolling,
412    #[serde(rename = "VERTICAL_SCROLLING")]
413    VerticalScrolling,
414    #[serde(rename = "HORIZONTAL_AND_VERTICAL_SCROLLING")]
415    HorizontalAndVerticalScrolling,
416    #[serde(rename = "NONE")]
417    None,
418}
419
420impl Default for OverflowDirection {
421    fn default() -> OverflowDirection {
422        Self::HorizontalScrolling
423    }
424}
425/// Whether this layer uses auto-layout to position its children.
426#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
427pub enum LayoutMode {
428    #[serde(rename = "NONE")]
429    None,
430    #[serde(rename = "HORIZONTAL")]
431    Horizontal,
432    #[serde(rename = "VERTICAL")]
433    Vertical,
434}
435
436impl Default for LayoutMode {
437    fn default() -> LayoutMode {
438        Self::None
439    }
440}
441/// 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.
442#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
443pub enum PrimaryAxisSizingMode {
444    #[serde(rename = "FIXED")]
445    Fixed,
446    #[serde(rename = "AUTO")]
447    Auto,
448}
449
450impl Default for PrimaryAxisSizingMode {
451    fn default() -> PrimaryAxisSizingMode {
452        Self::Fixed
453    }
454}
455/// 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.
456#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
457pub enum CounterAxisSizingMode {
458    #[serde(rename = "FIXED")]
459    Fixed,
460    #[serde(rename = "AUTO")]
461    Auto,
462}
463
464impl Default for CounterAxisSizingMode {
465    fn default() -> CounterAxisSizingMode {
466        Self::Fixed
467    }
468}
469/// 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.
470#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
471pub enum PrimaryAxisAlignItems {
472    #[serde(rename = "MIN")]
473    Min,
474    #[serde(rename = "CENTER")]
475    Center,
476    #[serde(rename = "MAX")]
477    Max,
478    #[serde(rename = "SPACE_BETWEEN")]
479    SpaceBetween,
480}
481
482impl Default for PrimaryAxisAlignItems {
483    fn default() -> PrimaryAxisAlignItems {
484        Self::Min
485    }
486}
487/// 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.
488#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
489pub enum CounterAxisAlignItems {
490    #[serde(rename = "MIN")]
491    Min,
492    #[serde(rename = "CENTER")]
493    Center,
494    #[serde(rename = "MAX")]
495    Max,
496    #[serde(rename = "BASELINE")]
497    Baseline,
498}
499
500impl Default for CounterAxisAlignItems {
501    fn default() -> CounterAxisAlignItems {
502        Self::Min
503    }
504}
505/// Whether this auto-layout frame has wrapping enabled.
506#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
507pub enum LayoutWrap {
508    #[serde(rename = "NO_WRAP")]
509    NoWrap,
510    #[serde(rename = "WRAP")]
511    Wrap,
512}
513
514impl Default for LayoutWrap {
515    fn default() -> LayoutWrap {
516        Self::NoWrap
517    }
518}
519/// 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\"`.
520#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
521pub enum CounterAxisAlignContent {
522    #[serde(rename = "AUTO")]
523    Auto,
524    #[serde(rename = "SPACE_BETWEEN")]
525    SpaceBetween,
526}
527
528impl Default for CounterAxisAlignContent {
529    fn default() -> CounterAxisAlignContent {
530        Self::Auto
531    }
532}
533/// 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
534#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
535pub enum StrokeAlign {
536    #[serde(rename = "INSIDE")]
537    Inside,
538    #[serde(rename = "OUTSIDE")]
539    Outside,
540    #[serde(rename = "CENTER")]
541    Center,
542}
543
544impl Default for StrokeAlign {
545    fn default() -> StrokeAlign {
546        Self::Inside
547    }
548}
549/// A string enum with value of \"MITER\", \"BEVEL\", or \"ROUND\", describing how corners in vector paths are rendered.
550#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
551pub enum StrokeJoin {
552    #[serde(rename = "MITER")]
553    Miter,
554    #[serde(rename = "BEVEL")]
555    Bevel,
556    #[serde(rename = "ROUND")]
557    Round,
558}
559
560impl Default for StrokeJoin {
561    fn default() -> StrokeJoin {
562        Self::Miter
563    }
564}
565/// A string enum describing the end caps of vector paths.
566#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
567pub enum StrokeCap {
568    #[serde(rename = "NONE")]
569    None,
570    #[serde(rename = "ROUND")]
571    Round,
572    #[serde(rename = "SQUARE")]
573    Square,
574    #[serde(rename = "LINE_ARROW")]
575    LineArrow,
576    #[serde(rename = "TRIANGLE_ARROW")]
577    TriangleArrow,
578    #[serde(rename = "DIAMOND_FILLED")]
579    DiamondFilled,
580    #[serde(rename = "CIRCLE_FILLED")]
581    CircleFilled,
582    #[serde(rename = "TRIANGLE_FILLED")]
583    TriangleFilled,
584    #[serde(rename = "WASHI_TAPE_1")]
585    WashiTape1,
586    #[serde(rename = "WASHI_TAPE_2")]
587    WashiTape2,
588    #[serde(rename = "WASHI_TAPE_3")]
589    WashiTape3,
590    #[serde(rename = "WASHI_TAPE_4")]
591    WashiTape4,
592    #[serde(rename = "WASHI_TAPE_5")]
593    WashiTape5,
594    #[serde(rename = "WASHI_TAPE_6")]
595    WashiTape6,
596}
597
598impl Default for StrokeCap {
599    fn default() -> StrokeCap {
600        Self::None
601    }
602}
603/// 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.
604#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
605pub enum MaskType {
606    #[serde(rename = "ALPHA")]
607    Alpha,
608    #[serde(rename = "VECTOR")]
609    Vector,
610    #[serde(rename = "LUMINANCE")]
611    Luminance,
612}
613
614impl Default for MaskType {
615    fn default() -> MaskType {
616        Self::Alpha
617    }
618}
619