figma_api/models/
set_variable_mode_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/// SetVariableModeAction : Sets a variable to a specific mode.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SetVariableModeAction {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "variableCollectionId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub variable_collection_id: Option<Option<String>>,
21    #[serde(rename = "variableModeId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub variable_mode_id: Option<Option<String>>,
23}
24
25impl SetVariableModeAction {
26    /// Sets a variable to a specific mode.
27    pub fn new(r#type: Type) -> SetVariableModeAction {
28        SetVariableModeAction {
29            r#type,
30            variable_collection_id: None,
31            variable_mode_id: 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_MODE")]
39    SetVariableMode,
40}
41
42impl Default for Type {
43    fn default() -> Type {
44        Self::SetVariableMode
45    }
46}
47