figma_api/models/local_variable_collection.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/// LocalVariableCollection : A grouping of related Variable objects each with the same modes.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LocalVariableCollection {
17 /// The unique identifier of this variable collection.
18 #[serde(rename = "id")]
19 pub id: String,
20 /// The name of this variable collection.
21 #[serde(rename = "name")]
22 pub name: String,
23 /// The key of this variable collection.
24 #[serde(rename = "key")]
25 pub key: String,
26 /// The modes of this variable collection.
27 #[serde(rename = "modes")]
28 pub modes: Vec<models::LocalVariableCollectionModesInner>,
29 /// The id of the default mode.
30 #[serde(rename = "defaultModeId")]
31 pub default_mode_id: String,
32 /// Whether this variable collection is remote.
33 #[serde(rename = "remote")]
34 pub remote: bool,
35 /// Whether this variable collection is hidden when publishing the current file as a library.
36 #[serde(rename = "hiddenFromPublishing")]
37 pub hidden_from_publishing: bool,
38 /// The ids of the variables in the collection. Note that the order of these variables is roughly the same as what is shown in Figma Design, however it does not account for groups. As a result, the order of these variables may not exactly reflect the exact ordering and grouping shown in the authoring UI.
39 #[serde(rename = "variableIds")]
40 pub variable_ids: Vec<String>,
41}
42
43impl LocalVariableCollection {
44 /// A grouping of related Variable objects each with the same modes.
45 pub fn new(id: String, name: String, key: String, modes: Vec<models::LocalVariableCollectionModesInner>, default_mode_id: String, remote: bool, hidden_from_publishing: bool, variable_ids: Vec<String>) -> LocalVariableCollection {
46 LocalVariableCollection {
47 id,
48 name,
49 key,
50 modes,
51 default_mode_id,
52 remote,
53 hidden_from_publishing,
54 variable_ids,
55 }
56 }
57}
58