figma_api/models/
get_file_meta.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct GetFileMeta {
16    /// The name of the file.
17    #[serde(rename = "name")]
18    pub name: String,
19    /// The name of the project containing the file.
20    #[serde(rename = "folder_name", skip_serializing_if = "Option::is_none")]
21    pub folder_name: Option<String>,
22    /// The UTC ISO 8601 time at which the file content was last modified.
23    #[serde(rename = "last_touched_at")]
24    pub last_touched_at: String,
25    /// The user who created the file.
26    #[serde(rename = "creator")]
27    pub creator: Box<models::User>,
28    /// The user who last modified the file contents.
29    #[serde(rename = "last_touched_by", skip_serializing_if = "Option::is_none")]
30    pub last_touched_by: Option<Box<models::User>>,
31    /// A URL to a thumbnail image of the file.
32    #[serde(rename = "thumbnail_url", skip_serializing_if = "Option::is_none")]
33    pub thumbnail_url: Option<String>,
34    #[serde(rename = "editorType")]
35    pub editor_type: models::EditorType,
36    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
37    pub role: Option<models::Role>,
38    #[serde(rename = "link_access", skip_serializing_if = "Option::is_none")]
39    pub link_access: Option<models::LinkAccess>,
40    /// The URL of the file.
41    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
42    pub url: Option<String>,
43    /// The version number of the file. This number is incremented when a file is modified and can be used to check if the file has changed between requests.
44    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
45    pub version: Option<String>,
46}
47
48impl GetFileMeta {
49    pub fn new(name: String, last_touched_at: String, creator: models::User, editor_type: models::EditorType) -> GetFileMeta {
50        GetFileMeta {
51            name,
52            folder_name: None,
53            last_touched_at,
54            creator: Box::new(creator),
55            last_touched_by: None,
56            thumbnail_url: None,
57            editor_type,
58            role: None,
59            link_access: None,
60            url: None,
61            version: None,
62        }
63    }
64}
65