figma_api/models/
variable_mode_update.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/// VariableModeUpdate : An object that contains details about updating a `VariableMode`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct VariableModeUpdate {
17    /// The action to perform for the variable mode.
18    #[serde(rename = "action")]
19    pub action: Action,
20    /// The id of the variable mode to update.
21    #[serde(rename = "id")]
22    pub id: String,
23    /// The name of this variable mode.
24    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
25    pub name: Option<String>,
26    /// The variable collection that contains the mode.
27    #[serde(rename = "variableCollectionId")]
28    pub variable_collection_id: String,
29}
30
31impl VariableModeUpdate {
32    /// An object that contains details about updating a `VariableMode`.
33    pub fn new(action: Action, id: String, variable_collection_id: String) -> VariableModeUpdate {
34        VariableModeUpdate {
35            action,
36            id,
37            name: None,
38            variable_collection_id,
39        }
40    }
41}
42/// The action to perform for the variable mode.
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum Action {
45    #[serde(rename = "UPDATE")]
46    Update,
47}
48
49impl Default for Action {
50    fn default() -> Action {
51        Self::Update
52    }
53}
54