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
/*
* 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};
/// LayoutConstraint : Layout constraint relative to containing Frame
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LayoutConstraint {
/// Vertical constraint (relative to containing frame) as an enum: - `TOP`: Node is laid out relative to top of the containing frame - `BOTTOM`: Node is laid out relative to bottom of the containing frame - `CENTER`: Node is vertically centered relative to containing frame - `TOP_BOTTOM`: Both top and bottom of node are constrained relative to containing frame (node stretches with frame) - `SCALE`: Node scales vertically with containing frame
#[serde(rename = "vertical")]
pub vertical: Vertical,
/// Horizontal constraint (relative to containing frame) as an enum: - `LEFT`: Node is laid out relative to left of the containing frame - `RIGHT`: Node is laid out relative to right of the containing frame - `CENTER`: Node is horizontally centered relative to containing frame - `LEFT_RIGHT`: Both left and right of node are constrained relative to containing frame (node stretches with frame) - `SCALE`: Node scales horizontally with containing frame
#[serde(rename = "horizontal")]
pub horizontal: Horizontal,
}
impl LayoutConstraint {
/// Layout constraint relative to containing Frame
pub fn new(vertical: Vertical, horizontal: Horizontal) -> LayoutConstraint {
LayoutConstraint {
vertical,
horizontal,
}
}
}
/// Vertical constraint (relative to containing frame) as an enum: - `TOP`: Node is laid out relative to top of the containing frame - `BOTTOM`: Node is laid out relative to bottom of the containing frame - `CENTER`: Node is vertically centered relative to containing frame - `TOP_BOTTOM`: Both top and bottom of node are constrained relative to containing frame (node stretches with frame) - `SCALE`: Node scales vertically with containing frame
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Vertical {
#[serde(rename = "TOP")]
Top,
#[serde(rename = "BOTTOM")]
Bottom,
#[serde(rename = "CENTER")]
Center,
#[serde(rename = "TOP_BOTTOM")]
TopBottom,
#[serde(rename = "SCALE")]
Scale,
}
impl Default for Vertical {
fn default() -> Vertical {
Self::Top
}
}
/// Horizontal constraint (relative to containing frame) as an enum: - `LEFT`: Node is laid out relative to left of the containing frame - `RIGHT`: Node is laid out relative to right of the containing frame - `CENTER`: Node is horizontally centered relative to containing frame - `LEFT_RIGHT`: Both left and right of node are constrained relative to containing frame (node stretches with frame) - `SCALE`: Node scales horizontally with containing frame
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Horizontal {
#[serde(rename = "LEFT")]
Left,
#[serde(rename = "RIGHT")]
Right,
#[serde(rename = "CENTER")]
Center,
#[serde(rename = "LEFT_RIGHT")]
LeftRight,
#[serde(rename = "SCALE")]
Scale,
}
impl Default for Horizontal {
fn default() -> Horizontal {
Self::Left
}
}