figma_api/models/
variable_collection_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/// VariableCollectionCreate : An object that contains details about creating a `VariableCollection`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct VariableCollectionCreate {
17    /// The action to perform for the variable collection.
18    #[serde(rename = "action")]
19    pub action: Action,
20    /// A temporary id for this variable collection.
21    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
22    pub id: Option<String>,
23    /// The name of this variable collection.
24    #[serde(rename = "name")]
25    pub name: String,
26    /// The initial mode refers to the mode that is created by default. You can set a temporary id here, in order to reference this mode later in this request.
27    #[serde(rename = "initialModeId", skip_serializing_if = "Option::is_none")]
28    pub initial_mode_id: Option<String>,
29    /// Whether this variable collection is hidden when publishing the current file as a library.
30    #[serde(rename = "hiddenFromPublishing", skip_serializing_if = "Option::is_none")]
31    pub hidden_from_publishing: Option<bool>,
32}
33
34impl VariableCollectionCreate {
35    /// An object that contains details about creating a `VariableCollection`.
36    pub fn new(action: Action, name: String) -> VariableCollectionCreate {
37        VariableCollectionCreate {
38            action,
39            id: None,
40            name,
41            initial_mode_id: None,
42            hidden_from_publishing: None,
43        }
44    }
45}
46/// The action to perform for the variable collection.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Action {
49    #[serde(rename = "CREATE")]
50    Create,
51}
52
53impl Default for Action {
54    fn default() -> Action {
55        Self::Create
56    }
57}
58