figma_api/models/version.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/// Version : A version of a file
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Version {
17 /// Unique identifier for version
18 #[serde(rename = "id")]
19 pub id: String,
20 /// The UTC ISO 8601 time at which the version was created
21 #[serde(rename = "created_at")]
22 pub created_at: String,
23 /// The label given to the version in the editor
24 #[serde(rename = "label", deserialize_with = "Option::deserialize")]
25 pub label: Option<String>,
26 /// The description of the version as entered in the editor
27 #[serde(rename = "description", deserialize_with = "Option::deserialize")]
28 pub description: Option<String>,
29 /// The user that created the version
30 #[serde(rename = "user")]
31 pub user: Box<models::User>,
32 /// A URL to a thumbnail image of the file version.
33 #[serde(rename = "thumbnail_url", skip_serializing_if = "Option::is_none")]
34 pub thumbnail_url: Option<String>,
35}
36
37impl Version {
38 /// A version of a file
39 pub fn new(id: String, created_at: String, label: Option<String>, description: Option<String>, user: models::User) -> Version {
40 Version {
41 id,
42 created_at,
43 label,
44 description,
45 user: Box::new(user),
46 thumbnail_url: None,
47 }
48 }
49}
50