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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
/*
 * 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, Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum SubcanvasNode {
    #[serde(rename="BOOLEAN_OPERATION")]
    BooleanOperation(Box<models::BooleanOperationNode>),
    #[serde(rename="COMPONENT")]
    Component(Box<models::ComponentNode>),
    #[serde(rename="COMPONENT_SET")]
    ComponentSet(Box<models::ComponentSetNode>),
    #[serde(rename="CONNECTOR")]
    Connector(Box<models::ConnectorNode>),
    #[serde(rename="ELLIPSE")]
    Ellipse(Box<models::EllipseNode>),
    #[serde(rename="EMBED")]
    Embed(Box<models::EmbedNode>),
    #[serde(rename="FRAME")]
    Frame(Box<models::FrameNode>),
    #[serde(rename="GROUP")]
    Group(Box<models::GroupNode>),
    #[serde(rename="INSTANCE")]
    Instance(Box<models::InstanceNode>),
    #[serde(rename="LINE")]
    Line(Box<models::LineNode>),
    #[serde(rename="LINK_UNFURL")]
    LinkUnfurl(Box<models::LinkUnfurlNode>),
    #[serde(rename="RECTANGLE")]
    Rectangle(Box<models::RectangleNode>),
    #[serde(rename="REGULAR_POLYGON")]
    RegularPolygon(Box<models::RegularPolygonNode>),
    #[serde(rename="SECTION")]
    Section(Box<models::SectionNode>),
    #[serde(rename="SHAPE_WITH_TEXT")]
    ShapeWithText(Box<models::ShapeWithTextNode>),
    #[serde(rename="SLICE")]
    Slice(Box<models::SliceNode>),
    #[serde(rename="STAR")]
    Star(Box<models::StarNode>),
    #[serde(rename="STICKY")]
    Sticky(Box<models::StickyNode>),
    #[serde(rename="TABLE")]
    Table(Box<models::TableNode>),
    #[serde(rename="TABLE_CELL")]
    TableCell(Box<models::TableCellNode>),
    #[serde(rename="TEXT")]
    Text(Box<models::TextNode>),
    #[serde(rename="TEXT_PATH")]
    TextPath(Box<models::TextPathNode>),
    #[serde(rename="TRANSFORM_GROUP")]
    TransformGroup(Box<models::TransformGroupNode>),
    #[serde(rename="VECTOR")]
    Vector(Box<models::VectorNode>),
    #[serde(rename="WASHI_TAPE")]
    WashiTape(Box<models::WashiTapeNode>),
    #[serde(rename="WIDGET")]
    Widget(Box<models::WidgetNode>),
}

impl Default for SubcanvasNode {
    fn default() -> Self {
        Self::BooleanOperation(Default::default())
    }
}

/// A string enum indicating the type of boolean operation applied.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BooleanOperation {
    #[serde(rename = "UNION")]
    Union,
    #[serde(rename = "INTERSECT")]
    Intersect,
    #[serde(rename = "SUBTRACT")]
    Subtract,
    #[serde(rename = "EXCLUDE")]
    Exclude,
}

impl Default for BooleanOperation {
    fn default() -> BooleanOperation {
        Self::Union
    }
}
/// 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
    }
}
/// 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
    }
}
/// 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
    }
}
/// A string enum describing the end cap of the start of the connector.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ConnectorStartStrokeCap {
    #[serde(rename = "NONE")]
    None,
    #[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,
}

impl Default for ConnectorStartStrokeCap {
    fn default() -> ConnectorStartStrokeCap {
        Self::None
    }
}
/// A string enum describing the end cap of the end of the connector.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ConnectorEndStrokeCap {
    #[serde(rename = "NONE")]
    None,
    #[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,
}

impl Default for ConnectorEndStrokeCap {
    fn default() -> ConnectorEndStrokeCap {
        Self::None
    }
}
/// 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).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LineTypes {
    #[serde(rename = "NONE")]
    None,
    #[serde(rename = "ORDERED")]
    Ordered,
    #[serde(rename = "UNORDERED")]
    Unordered,
}

impl Default for LineTypes {
    fn default() -> LineTypes {
        Self::None
    }
}