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
/*
* Figma API
*
* This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api). Note: we are releasing the OpenAPI specification as a beta given the large surface area and complexity of the REST API. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues).
*
* The version of the OpenAPI document: 0.31.0
* Contact: support@figma.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct HasFramePropertiesTrait {
/// Whether or not this node clip content outside of its bounds
#[serde(rename = "clipsContent")]
pub clips_content: bool,
/// Background of the node. This is deprecated, as backgrounds for frames are now in the `fills` field.
#[serde(rename = "background", skip_serializing_if = "Option::is_none")]
pub background: Option<Vec<models::Paint>>,
/// Background color of the node. This is deprecated, as frames now support more than a solid color as a background. Please use the `fills` field instead.
#[serde(rename = "backgroundColor", skip_serializing_if = "Option::is_none")]
pub background_color: Option<Box<models::Rgba>>,
/// An array of layout grids attached to this node (see layout grids section for more details). GROUP nodes do not have this attribute
#[serde(rename = "layoutGrids", skip_serializing_if = "Option::is_none")]
pub layout_grids: Option<Vec<models::LayoutGrid>>,
/// Whether a node has primary axis scrolling, horizontal or vertical.
#[serde(rename = "overflowDirection", skip_serializing_if = "Option::is_none")]
pub overflow_direction: Option<OverflowDirection>,
/// Whether this layer uses auto-layout to position its children.
#[serde(rename = "layoutMode", skip_serializing_if = "Option::is_none")]
pub layout_mode: Option<LayoutMode>,
/// Whether the primary axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
#[serde(rename = "primaryAxisSizingMode", skip_serializing_if = "Option::is_none")]
pub primary_axis_sizing_mode: Option<PrimaryAxisSizingMode>,
/// Whether the counter axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
#[serde(rename = "counterAxisSizingMode", skip_serializing_if = "Option::is_none")]
pub counter_axis_sizing_mode: Option<CounterAxisSizingMode>,
/// Determines how the auto-layout frame's children should be aligned in the primary axis direction. This property is only applicable for auto-layout frames.
#[serde(rename = "primaryAxisAlignItems", skip_serializing_if = "Option::is_none")]
pub primary_axis_align_items: Option<PrimaryAxisAlignItems>,
/// Determines how the auto-layout frame's children should be aligned in the counter axis direction. This property is only applicable for auto-layout frames.
#[serde(rename = "counterAxisAlignItems", skip_serializing_if = "Option::is_none")]
pub counter_axis_align_items: Option<CounterAxisAlignItems>,
/// The padding between the left border of the frame and its children. This property is only applicable for auto-layout frames.
#[serde(rename = "paddingLeft", skip_serializing_if = "Option::is_none")]
pub padding_left: Option<f64>,
/// The padding between the right border of the frame and its children. This property is only applicable for auto-layout frames.
#[serde(rename = "paddingRight", skip_serializing_if = "Option::is_none")]
pub padding_right: Option<f64>,
/// The padding between the top border of the frame and its children. This property is only applicable for auto-layout frames.
#[serde(rename = "paddingTop", skip_serializing_if = "Option::is_none")]
pub padding_top: Option<f64>,
/// The padding between the bottom border of the frame and its children. This property is only applicable for auto-layout frames.
#[serde(rename = "paddingBottom", skip_serializing_if = "Option::is_none")]
pub padding_bottom: Option<f64>,
/// The distance between children of the frame. Can be negative. This property is only applicable for auto-layout frames.
#[serde(rename = "itemSpacing", skip_serializing_if = "Option::is_none")]
pub item_spacing: Option<f64>,
/// Determines the canvas stacking order of layers in this frame. When true, the first layer will be draw on top. This property is only applicable for auto-layout frames.
#[serde(rename = "itemReverseZIndex", skip_serializing_if = "Option::is_none")]
pub item_reverse_z_index: Option<bool>,
/// Determines whether strokes are included in layout calculations. When true, auto-layout frames behave like css \"box-sizing: border-box\". This property is only applicable for auto-layout frames.
#[serde(rename = "strokesIncludedInLayout", skip_serializing_if = "Option::is_none")]
pub strokes_included_in_layout: Option<bool>,
/// Whether this auto-layout frame has wrapping enabled.
#[serde(rename = "layoutWrap", skip_serializing_if = "Option::is_none")]
pub layout_wrap: Option<LayoutWrap>,
/// The distance between wrapped tracks of an auto-layout frame. This property is only applicable for auto-layout frames with `layoutWrap: \"WRAP\"`
#[serde(rename = "counterAxisSpacing", skip_serializing_if = "Option::is_none")]
pub counter_axis_spacing: Option<f64>,
/// Determines how the auto-layout frame’s wrapped tracks should be aligned in the counter axis direction. This property is only applicable for auto-layout frames with `layoutWrap: \"WRAP\"`.
#[serde(rename = "counterAxisAlignContent", skip_serializing_if = "Option::is_none")]
pub counter_axis_align_content: Option<CounterAxisAlignContent>,
}
impl HasFramePropertiesTrait {
pub fn new(clips_content: bool) -> HasFramePropertiesTrait {
HasFramePropertiesTrait {
clips_content,
background: None,
background_color: None,
layout_grids: None,
overflow_direction: None,
layout_mode: None,
primary_axis_sizing_mode: None,
counter_axis_sizing_mode: None,
primary_axis_align_items: None,
counter_axis_align_items: None,
padding_left: None,
padding_right: None,
padding_top: None,
padding_bottom: None,
item_spacing: None,
item_reverse_z_index: None,
strokes_included_in_layout: None,
layout_wrap: None,
counter_axis_spacing: None,
counter_axis_align_content: None,
}
}
}
/// Whether a node has primary axis scrolling, horizontal or vertical.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OverflowDirection {
#[serde(rename = "HORIZONTAL_SCROLLING")]
HorizontalScrolling,
#[serde(rename = "VERTICAL_SCROLLING")]
VerticalScrolling,
#[serde(rename = "HORIZONTAL_AND_VERTICAL_SCROLLING")]
HorizontalAndVerticalScrolling,
#[serde(rename = "NONE")]
None,
}
impl Default for OverflowDirection {
fn default() -> OverflowDirection {
Self::HorizontalScrolling
}
}
/// Whether this layer uses auto-layout to position its children.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LayoutMode {
#[serde(rename = "NONE")]
None,
#[serde(rename = "HORIZONTAL")]
Horizontal,
#[serde(rename = "VERTICAL")]
Vertical,
}
impl Default for LayoutMode {
fn default() -> LayoutMode {
Self::None
}
}
/// Whether the primary axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PrimaryAxisSizingMode {
#[serde(rename = "FIXED")]
Fixed,
#[serde(rename = "AUTO")]
Auto,
}
impl Default for PrimaryAxisSizingMode {
fn default() -> PrimaryAxisSizingMode {
Self::Fixed
}
}
/// Whether the counter axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CounterAxisSizingMode {
#[serde(rename = "FIXED")]
Fixed,
#[serde(rename = "AUTO")]
Auto,
}
impl Default for CounterAxisSizingMode {
fn default() -> CounterAxisSizingMode {
Self::Fixed
}
}
/// Determines how the auto-layout frame's children should be aligned in the primary axis direction. This property is only applicable for auto-layout frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PrimaryAxisAlignItems {
#[serde(rename = "MIN")]
Min,
#[serde(rename = "CENTER")]
Center,
#[serde(rename = "MAX")]
Max,
#[serde(rename = "SPACE_BETWEEN")]
SpaceBetween,
}
impl Default for PrimaryAxisAlignItems {
fn default() -> PrimaryAxisAlignItems {
Self::Min
}
}
/// Determines how the auto-layout frame's children should be aligned in the counter axis direction. This property is only applicable for auto-layout frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CounterAxisAlignItems {
#[serde(rename = "MIN")]
Min,
#[serde(rename = "CENTER")]
Center,
#[serde(rename = "MAX")]
Max,
#[serde(rename = "BASELINE")]
Baseline,
}
impl Default for CounterAxisAlignItems {
fn default() -> CounterAxisAlignItems {
Self::Min
}
}
/// Whether this auto-layout frame has wrapping enabled.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LayoutWrap {
#[serde(rename = "NO_WRAP")]
NoWrap,
#[serde(rename = "WRAP")]
Wrap,
}
impl Default for LayoutWrap {
fn default() -> LayoutWrap {
Self::NoWrap
}
}
/// Determines how the auto-layout frame’s wrapped tracks should be aligned in the counter axis direction. This property is only applicable for auto-layout frames with `layoutWrap: \"WRAP\"`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CounterAxisAlignContent {
#[serde(rename = "AUTO")]
Auto,
#[serde(rename = "SPACE_BETWEEN")]
SpaceBetween,
}
impl Default for CounterAxisAlignContent {
fn default() -> CounterAxisAlignContent {
Self::Auto
}
}