figma_api/models/
published_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/// PublishedStyle : A set of published properties that can be applied to nodes.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PublishedStyle {
17    /// The unique identifier for the style
18    #[serde(rename = "key")]
19    pub key: String,
20    /// The unique identifier of the Figma file that contains the style.
21    #[serde(rename = "file_key")]
22    pub file_key: String,
23    /// ID of the style node within the figma file
24    #[serde(rename = "node_id")]
25    pub node_id: String,
26    #[serde(rename = "style_type")]
27    pub style_type: models::StyleType,
28    /// A URL to a thumbnail image of the style.
29    #[serde(rename = "thumbnail_url", skip_serializing_if = "Option::is_none")]
30    pub thumbnail_url: Option<String>,
31    /// The name of the style.
32    #[serde(rename = "name")]
33    pub name: String,
34    /// The description of the style as entered by the publisher.
35    #[serde(rename = "description")]
36    pub description: String,
37    /// The UTC ISO 8601 time when the style was created.
38    #[serde(rename = "created_at")]
39    pub created_at: String,
40    /// The UTC ISO 8601 time when the style was last updated.
41    #[serde(rename = "updated_at")]
42    pub updated_at: String,
43    /// The user who last updated the style.
44    #[serde(rename = "user")]
45    pub user: Box<models::User>,
46    /// A user specified order number by which the style can be sorted.
47    #[serde(rename = "sort_position")]
48    pub sort_position: String,
49}
50
51impl PublishedStyle {
52    /// A set of published properties that can be applied to nodes.
53    pub fn new(key: String, file_key: String, node_id: String, style_type: models::StyleType, name: String, description: String, created_at: String, updated_at: String, user: models::User, sort_position: String) -> PublishedStyle {
54        PublishedStyle {
55            key,
56            file_key,
57            node_id,
58            style_type,
59            thumbnail_url: None,
60            name,
61            description,
62            created_at,
63            updated_at,
64            user: Box::new(user),
65            sort_position,
66        }
67    }
68}
69