figma_api/models/style.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/// Style : A set of properties that can be applied to nodes and published. Styles for a property can be created in the corresponding property's panel while editing a file.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Style {
17 /// The key of the style
18 #[serde(rename = "key")]
19 pub key: String,
20 /// Name of the style
21 #[serde(rename = "name")]
22 pub name: String,
23 /// Description of the style
24 #[serde(rename = "description")]
25 pub description: String,
26 /// Whether this style is a remote style that doesn't live in this file
27 #[serde(rename = "remote")]
28 pub remote: bool,
29 #[serde(rename = "styleType")]
30 pub style_type: models::StyleType,
31}
32
33impl Style {
34 /// A set of properties that can be applied to nodes and published. Styles for a property can be created in the corresponding property's panel while editing a file.
35 pub fn new(key: String, name: String, description: String, remote: bool, style_type: models::StyleType) -> Style {
36 Style {
37 key,
38 name,
39 description,
40 remote,
41 style_type,
42 }
43 }
44}
45