figma_api/models/
variable_mode_create.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/// VariableModeCreate : An object that contains details about creating a `VariableMode`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct VariableModeCreate {
17    /// The action to perform for the variable mode.
18    #[serde(rename = "action")]
19    pub action: Action,
20    /// A temporary id for this variable mode.
21    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
22    pub id: Option<String>,
23    /// The name of this variable mode.
24    #[serde(rename = "name")]
25    pub name: String,
26    /// The variable collection that will contain the mode. You can use the temporary id of a variable collection.
27    #[serde(rename = "variableCollectionId")]
28    pub variable_collection_id: String,
29}
30
31impl VariableModeCreate {
32    /// An object that contains details about creating a `VariableMode`.
33    pub fn new(action: Action, name: String, variable_collection_id: String) -> VariableModeCreate {
34        VariableModeCreate {
35            action,
36            id: None,
37            name,
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 = "CREATE")]
46    Create,
47}
48
49impl Default for Action {
50    fn default() -> Action {
51        Self::Create
52    }
53}
54