figma_api/models/
set_variable_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/// SetVariableAction : Sets a variable to a specific value.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SetVariableAction {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "variableId", deserialize_with = "Option::deserialize")]
20    pub variable_id: Option<String>,
21    #[serde(rename = "variableValue", skip_serializing_if = "Option::is_none")]
22    pub variable_value: Option<Box<models::VariableData>>,
23}
24
25impl SetVariableAction {
26    /// Sets a variable to a specific value.
27    pub fn new(r#type: Type, variable_id: Option<String>) -> SetVariableAction {
28        SetVariableAction {
29            r#type,
30            variable_id,
31            variable_value: None,
32        }
33    }
34}
35/// 
36#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
37pub enum Type {
38    #[serde(rename = "SET_VARIABLE")]
39    SetVariable,
40}
41
42impl Default for Type {
43    fn default() -> Type {
44        Self::SetVariable
45    }
46}
47