figma_api/models/
conditional_action.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/// ConditionalAction : Checks if a condition is met before performing certain actions by using an if/else conditional statement.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ConditionalAction {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "conditionalBlocks")]
20    pub conditional_blocks: Vec<models::ConditionalBlock>,
21}
22
23impl ConditionalAction {
24    /// Checks if a condition is met before performing certain actions by using an if/else conditional statement.
25    pub fn new(r#type: Type, conditional_blocks: Vec<models::ConditionalBlock>) -> ConditionalAction {
26        ConditionalAction {
27            r#type,
28            conditional_blocks,
29        }
30    }
31}
32/// 
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum Type {
35    #[serde(rename = "CONDITIONAL")]
36    Conditional,
37}
38
39impl Default for Type {
40    fn default() -> Type {
41        Self::Conditional
42    }
43}
44