figma_api/models/
directional_transition.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/// DirectionalTransition : Describes an animation used when navigating in a prototype.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DirectionalTransition {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "direction")]
20    pub direction: Direction,
21    /// The duration of the transition in milliseconds.
22    #[serde(rename = "duration")]
23    pub duration: f64,
24    /// The easing curve of the transition.
25    #[serde(rename = "easing")]
26    pub easing: Box<models::Easing>,
27    /// When the transition `type` is `\"SMART_ANIMATE\"` or when `matchLayers` is `true`, then the transition will be performed using smart animate, which attempts to match corresponding layers an interpolate other properties during the animation.
28    #[serde(rename = "matchLayers", skip_serializing_if = "Option::is_none")]
29    pub match_layers: Option<bool>,
30}
31
32impl DirectionalTransition {
33    /// Describes an animation used when navigating in a prototype.
34    pub fn new(r#type: Type, direction: Direction, duration: f64, easing: models::Easing) -> DirectionalTransition {
35        DirectionalTransition {
36            r#type,
37            direction,
38            duration,
39            easing: Box::new(easing),
40            match_layers: None,
41        }
42    }
43}
44/// 
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum Type {
47    #[serde(rename = "MOVE_IN")]
48    MoveIn,
49    #[serde(rename = "MOVE_OUT")]
50    MoveOut,
51    #[serde(rename = "PUSH")]
52    Push,
53    #[serde(rename = "SLIDE_IN")]
54    SlideIn,
55    #[serde(rename = "SLIDE_OUT")]
56    SlideOut,
57}
58
59impl Default for Type {
60    fn default() -> Type {
61        Self::MoveIn
62    }
63}
64/// 
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum Direction {
67    #[serde(rename = "LEFT")]
68    Left,
69    #[serde(rename = "RIGHT")]
70    Right,
71    #[serde(rename = "TOP")]
72    Top,
73    #[serde(rename = "BOTTOM")]
74    Bottom,
75}
76
77impl Default for Direction {
78    fn default() -> Direction {
79        Self::Left
80    }
81}
82