figma_api/models/
simple_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/// SimpleTransition : Describes an animation used when navigating in a prototype.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SimpleTransition {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    /// The duration of the transition in milliseconds.
20    #[serde(rename = "duration")]
21    pub duration: f64,
22    /// The easing curve of the transition.
23    #[serde(rename = "easing")]
24    pub easing: Box<models::Easing>,
25}
26
27impl SimpleTransition {
28    /// Describes an animation used when navigating in a prototype.
29    pub fn new(r#type: Type, duration: f64, easing: models::Easing) -> SimpleTransition {
30        SimpleTransition {
31            r#type,
32            duration,
33            easing: Box::new(easing),
34        }
35    }
36}
37/// 
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Type {
40    #[serde(rename = "DISSOLVE")]
41    Dissolve,
42    #[serde(rename = "SMART_ANIMATE")]
43    SmartAnimate,
44    #[serde(rename = "SCROLL_ANIMATE")]
45    ScrollAnimate,
46}
47
48impl Default for Type {
49    fn default() -> Type {
50        Self::Dissolve
51    }
52}
53