figma_api/models/
inline_object_1.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 InlineObject1 {
16    /// The name of the file as it appears in the editor.
17    #[serde(rename = "name")]
18    pub name: String,
19    /// The role of the user making the API request in relation to the file.
20    #[serde(rename = "role")]
21    pub role: Role,
22    /// The UTC ISO 8601 time at which the file was last modified.
23    #[serde(rename = "lastModified")]
24    pub last_modified: String,
25    /// The type of editor associated with this file.
26    #[serde(rename = "editorType")]
27    pub editor_type: EditorType,
28    /// A URL to a thumbnail image of the file.
29    #[serde(rename = "thumbnailUrl")]
30    pub thumbnail_url: String,
31    /// 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.
32    #[serde(rename = "version")]
33    pub version: String,
34    /// A mapping from node IDs to node metadata.
35    #[serde(rename = "nodes")]
36    pub nodes: std::collections::HashMap<String, models::InlineObject1NodesValue>,
37}
38
39impl InlineObject1 {
40    pub fn new(name: String, role: Role, last_modified: String, editor_type: EditorType, thumbnail_url: String, version: String, nodes: std::collections::HashMap<String, models::InlineObject1NodesValue>) -> InlineObject1 {
41        InlineObject1 {
42            name,
43            role,
44            last_modified,
45            editor_type,
46            thumbnail_url,
47            version,
48            nodes,
49        }
50    }
51}
52/// The role of the user making the API request in relation to the file.
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum Role {
55    #[serde(rename = "owner")]
56    Owner,
57    #[serde(rename = "editor")]
58    Editor,
59    #[serde(rename = "viewer")]
60    Viewer,
61}
62
63impl Default for Role {
64    fn default() -> Role {
65        Self::Owner
66    }
67}
68/// The type of editor associated with this file.
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum EditorType {
71    #[serde(rename = "figma")]
72    Figma,
73    #[serde(rename = "figjam")]
74    Figjam,
75}
76
77impl Default for EditorType {
78    fn default() -> EditorType {
79        Self::Figma
80    }
81}
82