figma_api/models/variable_collection_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/// VariableCollectionUpdate : An object that contains details about updating a `VariableCollection`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct VariableCollectionUpdate {
17 /// The action to perform for the variable collection.
18 #[serde(rename = "action")]
19 pub action: Action,
20 /// The id of the variable collection to update.
21 #[serde(rename = "id")]
22 pub id: String,
23 /// The name of this variable collection.
24 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
25 pub name: Option<String>,
26 /// Whether this variable collection is hidden when publishing the current file as a library.
27 #[serde(rename = "hiddenFromPublishing", skip_serializing_if = "Option::is_none")]
28 pub hidden_from_publishing: Option<bool>,
29}
30
31impl VariableCollectionUpdate {
32 /// An object that contains details about updating a `VariableCollection`.
33 pub fn new(action: Action, id: String) -> VariableCollectionUpdate {
34 VariableCollectionUpdate {
35 action,
36 id,
37 name: None,
38 hidden_from_publishing: None,
39 }
40 }
41}
42/// The action to perform for the variable collection.
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