figma_api/models/
trigger_one_of_1.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct TriggerOneOf1 {
16    #[serde(rename = "type")]
17    pub r#type: Type,
18    #[serde(rename = "delay")]
19    pub delay: f64,
20    /// Whether this is a [deprecated version](https://help.figma.com/hc/en-us/articles/360040035834-Prototype-triggers#h_01HHN04REHJNP168R26P1CMP0A) of the trigger that was left unchanged for backwards compatibility. If not present, the trigger is the latest version.
21    #[serde(rename = "deprecatedVersion", skip_serializing_if = "Option::is_none")]
22    pub deprecated_version: Option<bool>,
23}
24
25impl TriggerOneOf1 {
26    pub fn new(r#type: Type, delay: f64) -> TriggerOneOf1 {
27        TriggerOneOf1 {
28            r#type,
29            delay,
30            deprecated_version: None,
31        }
32    }
33}
34/// 
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Type {
37    #[serde(rename = "MOUSE_ENTER")]
38    MouseEnter,
39    #[serde(rename = "MOUSE_LEAVE")]
40    MouseLeave,
41    #[serde(rename = "MOUSE_UP")]
42    MouseUp,
43    #[serde(rename = "MOUSE_DOWN")]
44    MouseDown,
45}
46
47impl Default for Type {
48    fn default() -> Type {
49        Self::MouseEnter
50    }
51}
52