figma_api/models/instance_swap_preferred_value.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/// InstanceSwapPreferredValue : Instance swap preferred value.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct InstanceSwapPreferredValue {
17 /// Type of node for this preferred value.
18 #[serde(rename = "type")]
19 pub r#type: Type,
20 /// Key of this component or component set.
21 #[serde(rename = "key")]
22 pub key: String,
23}
24
25impl InstanceSwapPreferredValue {
26 /// Instance swap preferred value.
27 pub fn new(r#type: Type, key: String) -> InstanceSwapPreferredValue {
28 InstanceSwapPreferredValue {
29 r#type,
30 key,
31 }
32 }
33}
34/// Type of node for this preferred value.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Type {
37 #[serde(rename = "COMPONENT")]
38 Component,
39 #[serde(rename = "COMPONENT_SET")]
40 ComponentSet,
41}
42
43impl Default for Type {
44 fn default() -> Type {
45 Self::Component
46 }
47}
48