figma_api/models/
subcanvas_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, Debug, PartialEq, Serialize, Deserialize)]
15#[serde(tag = "type")]
16pub enum SubcanvasNode {
17    #[serde(rename="BOOLEAN_OPERATION")]
18    BooleanOperation(Box<models::BooleanOperationNode>),
19    #[serde(rename="COMPONENT")]
20    Component(Box<models::ComponentNode>),
21    #[serde(rename="COMPONENT_SET")]
22    ComponentSet(Box<models::ComponentSetNode>),
23    #[serde(rename="CONNECTOR")]
24    Connector(Box<models::ConnectorNode>),
25    #[serde(rename="ELLIPSE")]
26    Ellipse(Box<models::EllipseNode>),
27    #[serde(rename="EMBED")]
28    Embed(Box<models::EmbedNode>),
29    #[serde(rename="FRAME")]
30    Frame(Box<models::FrameNode>),
31    #[serde(rename="GROUP")]
32    Group(Box<models::GroupNode>),
33    #[serde(rename="INSTANCE")]
34    Instance(Box<models::InstanceNode>),
35    #[serde(rename="LINE")]
36    Line(Box<models::LineNode>),
37    #[serde(rename="LINK_UNFURL")]
38    LinkUnfurl(Box<models::LinkUnfurlNode>),
39    #[serde(rename="RECTANGLE")]
40    Rectangle(Box<models::RectangleNode>),
41    #[serde(rename="REGULAR_POLYGON")]
42    RegularPolygon(Box<models::RegularPolygonNode>),
43    #[serde(rename="SECTION")]
44    Section(Box<models::SectionNode>),
45    #[serde(rename="SHAPE_WITH_TEXT")]
46    ShapeWithText(Box<models::ShapeWithTextNode>),
47    #[serde(rename="SLICE")]
48    Slice(Box<models::SliceNode>),
49    #[serde(rename="STAR")]
50    Star(Box<models::StarNode>),
51    #[serde(rename="STICKY")]
52    Sticky(Box<models::StickyNode>),
53    #[serde(rename="TABLE")]
54    Table(Box<models::TableNode>),
55    #[serde(rename="TABLE_CELL")]
56    TableCell(Box<models::TableCellNode>),
57    #[serde(rename="TEXT")]
58    Text(Box<models::TextNode>),
59    #[serde(rename="TEXT_PATH")]
60    TextPath(Box<models::TextPathNode>),
61    #[serde(rename="TRANSFORM_GROUP")]
62    TransformGroup(Box<models::TransformGroupNode>),
63    #[serde(rename="VECTOR")]
64    Vector(Box<models::VectorNode>),
65    #[serde(rename="WASHI_TAPE")]
66    WashiTape(Box<models::WashiTapeNode>),
67    #[serde(rename="WIDGET")]
68    Widget(Box<models::WidgetNode>),
69}
70
71impl Default for SubcanvasNode {
72    fn default() -> Self {
73        Self::BooleanOperation(Default::default())
74    }
75}
76
77/// A string enum indicating the type of boolean operation applied.
78#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
79pub enum BooleanOperation {
80    #[serde(rename = "UNION")]
81    Union,
82    #[serde(rename = "INTERSECT")]
83    Intersect,
84    #[serde(rename = "SUBTRACT")]
85    Subtract,
86    #[serde(rename = "EXCLUDE")]
87    Exclude,
88}
89
90impl Default for BooleanOperation {
91    fn default() -> BooleanOperation {
92        Self::Union
93    }
94}
95/// How layer should be treated when the frame is resized
96#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
97pub enum ScrollBehavior {
98    #[serde(rename = "SCROLLS")]
99    Scrolls,
100    #[serde(rename = "FIXED")]
101    Fixed,
102    #[serde(rename = "STICKY_SCROLLS")]
103    StickyScrolls,
104}
105
106impl Default for ScrollBehavior {
107    fn default() -> ScrollBehavior {
108        Self::Scrolls
109    }
110}
111///  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\".
112#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
113pub enum LayoutAlign {
114    #[serde(rename = "INHERIT")]
115    Inherit,
116    #[serde(rename = "STRETCH")]
117    Stretch,
118    #[serde(rename = "MIN")]
119    Min,
120    #[serde(rename = "CENTER")]
121    Center,
122    #[serde(rename = "MAX")]
123    Max,
124}
125
126impl Default for LayoutAlign {
127    fn default() -> LayoutAlign {
128        Self::Inherit
129    }
130}
131/// Determines whether a layer's size and position should be determined by auto-layout settings or manually adjustable.
132#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
133pub enum LayoutPositioning {
134    #[serde(rename = "AUTO")]
135    Auto,
136    #[serde(rename = "ABSOLUTE")]
137    Absolute,
138}
139
140impl Default for LayoutPositioning {
141    fn default() -> LayoutPositioning {
142        Self::Auto
143    }
144}
145/// 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
146#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
147pub enum LayoutSizingHorizontal {
148    #[serde(rename = "FIXED")]
149    Fixed,
150    #[serde(rename = "HUG")]
151    Hug,
152    #[serde(rename = "FILL")]
153    Fill,
154}
155
156impl Default for LayoutSizingHorizontal {
157    fn default() -> LayoutSizingHorizontal {
158        Self::Fixed
159    }
160}
161/// 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
162#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
163pub enum LayoutSizingVertical {
164    #[serde(rename = "FIXED")]
165    Fixed,
166    #[serde(rename = "HUG")]
167    Hug,
168    #[serde(rename = "FILL")]
169    Fill,
170}
171
172impl Default for LayoutSizingVertical {
173    fn default() -> LayoutSizingVertical {
174        Self::Fixed
175    }
176}
177/// 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
178#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
179pub enum StrokeAlign {
180    #[serde(rename = "INSIDE")]
181    Inside,
182    #[serde(rename = "OUTSIDE")]
183    Outside,
184    #[serde(rename = "CENTER")]
185    Center,
186}
187
188impl Default for StrokeAlign {
189    fn default() -> StrokeAlign {
190        Self::Inside
191    }
192}
193/// A string enum with value of \"MITER\", \"BEVEL\", or \"ROUND\", describing how corners in vector paths are rendered.
194#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
195pub enum StrokeJoin {
196    #[serde(rename = "MITER")]
197    Miter,
198    #[serde(rename = "BEVEL")]
199    Bevel,
200    #[serde(rename = "ROUND")]
201    Round,
202}
203
204impl Default for StrokeJoin {
205    fn default() -> StrokeJoin {
206        Self::Miter
207    }
208}
209/// A string enum describing the end caps of vector paths.
210#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
211pub enum StrokeCap {
212    #[serde(rename = "NONE")]
213    None,
214    #[serde(rename = "ROUND")]
215    Round,
216    #[serde(rename = "SQUARE")]
217    Square,
218    #[serde(rename = "LINE_ARROW")]
219    LineArrow,
220    #[serde(rename = "TRIANGLE_ARROW")]
221    TriangleArrow,
222    #[serde(rename = "DIAMOND_FILLED")]
223    DiamondFilled,
224    #[serde(rename = "CIRCLE_FILLED")]
225    CircleFilled,
226    #[serde(rename = "TRIANGLE_FILLED")]
227    TriangleFilled,
228    #[serde(rename = "WASHI_TAPE_1")]
229    WashiTape1,
230    #[serde(rename = "WASHI_TAPE_2")]
231    WashiTape2,
232    #[serde(rename = "WASHI_TAPE_3")]
233    WashiTape3,
234    #[serde(rename = "WASHI_TAPE_4")]
235    WashiTape4,
236    #[serde(rename = "WASHI_TAPE_5")]
237    WashiTape5,
238    #[serde(rename = "WASHI_TAPE_6")]
239    WashiTape6,
240}
241
242impl Default for StrokeCap {
243    fn default() -> StrokeCap {
244        Self::None
245    }
246}
247/// 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.
248#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
249pub enum MaskType {
250    #[serde(rename = "ALPHA")]
251    Alpha,
252    #[serde(rename = "VECTOR")]
253    Vector,
254    #[serde(rename = "LUMINANCE")]
255    Luminance,
256}
257
258impl Default for MaskType {
259    fn default() -> MaskType {
260        Self::Alpha
261    }
262}
263/// Whether a node has primary axis scrolling, horizontal or vertical.
264#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
265pub enum OverflowDirection {
266    #[serde(rename = "HORIZONTAL_SCROLLING")]
267    HorizontalScrolling,
268    #[serde(rename = "VERTICAL_SCROLLING")]
269    VerticalScrolling,
270    #[serde(rename = "HORIZONTAL_AND_VERTICAL_SCROLLING")]
271    HorizontalAndVerticalScrolling,
272    #[serde(rename = "NONE")]
273    None,
274}
275
276impl Default for OverflowDirection {
277    fn default() -> OverflowDirection {
278        Self::HorizontalScrolling
279    }
280}
281/// Whether this layer uses auto-layout to position its children.
282#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
283pub enum LayoutMode {
284    #[serde(rename = "NONE")]
285    None,
286    #[serde(rename = "HORIZONTAL")]
287    Horizontal,
288    #[serde(rename = "VERTICAL")]
289    Vertical,
290}
291
292impl Default for LayoutMode {
293    fn default() -> LayoutMode {
294        Self::None
295    }
296}
297/// 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.
298#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
299pub enum PrimaryAxisSizingMode {
300    #[serde(rename = "FIXED")]
301    Fixed,
302    #[serde(rename = "AUTO")]
303    Auto,
304}
305
306impl Default for PrimaryAxisSizingMode {
307    fn default() -> PrimaryAxisSizingMode {
308        Self::Fixed
309    }
310}
311/// 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.
312#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
313pub enum CounterAxisSizingMode {
314    #[serde(rename = "FIXED")]
315    Fixed,
316    #[serde(rename = "AUTO")]
317    Auto,
318}
319
320impl Default for CounterAxisSizingMode {
321    fn default() -> CounterAxisSizingMode {
322        Self::Fixed
323    }
324}
325/// 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.
326#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
327pub enum PrimaryAxisAlignItems {
328    #[serde(rename = "MIN")]
329    Min,
330    #[serde(rename = "CENTER")]
331    Center,
332    #[serde(rename = "MAX")]
333    Max,
334    #[serde(rename = "SPACE_BETWEEN")]
335    SpaceBetween,
336}
337
338impl Default for PrimaryAxisAlignItems {
339    fn default() -> PrimaryAxisAlignItems {
340        Self::Min
341    }
342}
343/// 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.
344#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
345pub enum CounterAxisAlignItems {
346    #[serde(rename = "MIN")]
347    Min,
348    #[serde(rename = "CENTER")]
349    Center,
350    #[serde(rename = "MAX")]
351    Max,
352    #[serde(rename = "BASELINE")]
353    Baseline,
354}
355
356impl Default for CounterAxisAlignItems {
357    fn default() -> CounterAxisAlignItems {
358        Self::Min
359    }
360}
361/// Whether this auto-layout frame has wrapping enabled.
362#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
363pub enum LayoutWrap {
364    #[serde(rename = "NO_WRAP")]
365    NoWrap,
366    #[serde(rename = "WRAP")]
367    Wrap,
368}
369
370impl Default for LayoutWrap {
371    fn default() -> LayoutWrap {
372        Self::NoWrap
373    }
374}
375/// 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\"`.
376#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
377pub enum CounterAxisAlignContent {
378    #[serde(rename = "AUTO")]
379    Auto,
380    #[serde(rename = "SPACE_BETWEEN")]
381    SpaceBetween,
382}
383
384impl Default for CounterAxisAlignContent {
385    fn default() -> CounterAxisAlignContent {
386        Self::Auto
387    }
388}
389/// A string enum describing the end cap of the start of the connector.
390#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
391pub enum ConnectorStartStrokeCap {
392    #[serde(rename = "NONE")]
393    None,
394    #[serde(rename = "LINE_ARROW")]
395    LineArrow,
396    #[serde(rename = "TRIANGLE_ARROW")]
397    TriangleArrow,
398    #[serde(rename = "DIAMOND_FILLED")]
399    DiamondFilled,
400    #[serde(rename = "CIRCLE_FILLED")]
401    CircleFilled,
402    #[serde(rename = "TRIANGLE_FILLED")]
403    TriangleFilled,
404}
405
406impl Default for ConnectorStartStrokeCap {
407    fn default() -> ConnectorStartStrokeCap {
408        Self::None
409    }
410}
411/// A string enum describing the end cap of the end of the connector.
412#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
413pub enum ConnectorEndStrokeCap {
414    #[serde(rename = "NONE")]
415    None,
416    #[serde(rename = "LINE_ARROW")]
417    LineArrow,
418    #[serde(rename = "TRIANGLE_ARROW")]
419    TriangleArrow,
420    #[serde(rename = "DIAMOND_FILLED")]
421    DiamondFilled,
422    #[serde(rename = "CIRCLE_FILLED")]
423    CircleFilled,
424    #[serde(rename = "TRIANGLE_FILLED")]
425    TriangleFilled,
426}
427
428impl Default for ConnectorEndStrokeCap {
429    fn default() -> ConnectorEndStrokeCap {
430        Self::None
431    }
432}
433/// An array with the same number of elements as lines in the text node, where lines are delimited by newline or paragraph separator characters. Each element in the array corresponds to the list type of a specific line. List types are represented as string enums with one of these possible values:  - `NONE`: Not a list item. - `ORDERED`: Text is an ordered list (numbered). - `UNORDERED`: Text is an unordered list (bulleted).
434#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
435pub enum LineTypes {
436    #[serde(rename = "NONE")]
437    None,
438    #[serde(rename = "ORDERED")]
439    Ordered,
440    #[serde(rename = "UNORDERED")]
441    Unordered,
442}
443
444impl Default for LineTypes {
445    fn default() -> LineTypes {
446        Self::None
447    }
448}
449