figma_api/models/conditional_block.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/// ConditionalBlock : Either the if or else conditional blocks. The if block contains a condition to check. If that condition is met then it will run those list of actions, else it will run the actions in the else block.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ConditionalBlock {
17 #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
18 pub condition: Option<Box<models::VariableData>>,
19 #[serde(rename = "actions")]
20 pub actions: Vec<models::Action>,
21}
22
23impl ConditionalBlock {
24 /// Either the if or else conditional blocks. The if block contains a condition to check. If that condition is met then it will run those list of actions, else it will run the actions in the else block.
25 pub fn new(actions: Vec<models::Action>) -> ConditionalBlock {
26 ConditionalBlock {
27 condition: None,
28 actions,
29 }
30 }
31}
32