figma-api 0.31.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).
Documentation
/*
 * Figma API
 *
 * 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).
 *
 * The version of the OpenAPI document: 0.31.0
 * Contact: support@figma.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetFile {
    /// The name of the file as it appears in the editor.
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "role")]
    pub role: models::Role,
    /// The UTC ISO 8601 time at which the file was last modified.
    #[serde(rename = "lastModified")]
    pub last_modified: String,
    #[serde(rename = "editorType")]
    pub editor_type: models::EditorType,
    /// A URL to a thumbnail image of the file.
    #[serde(rename = "thumbnailUrl", skip_serializing_if = "Option::is_none")]
    pub thumbnail_url: Option<String>,
    /// 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.
    #[serde(rename = "version")]
    pub version: String,
    #[serde(rename = "document")]
    pub document: Box<models::DocumentNode>,
    /// A mapping from component IDs to component metadata.
    #[serde(rename = "components")]
    pub components: std::collections::HashMap<String, models::Component>,
    /// A mapping from component set IDs to component set metadata.
    #[serde(rename = "componentSets")]
    pub component_sets: std::collections::HashMap<String, models::ComponentSet>,
    /// The version of the file schema that this file uses.
    #[serde(rename = "schemaVersion")]
    pub schema_version: f64,
    /// A mapping from style IDs to style metadata.
    #[serde(rename = "styles")]
    pub styles: std::collections::HashMap<String, models::Style>,
    /// The share permission level of the file link.
    #[serde(rename = "linkAccess", skip_serializing_if = "Option::is_none")]
    pub link_access: Option<String>,
    /// The key of the main file for this file. If present, this file is a component or component set.
    #[serde(rename = "mainFileKey", skip_serializing_if = "Option::is_none")]
    pub main_file_key: Option<String>,
    /// A list of branches for this file.
    #[serde(rename = "branches", skip_serializing_if = "Option::is_none")]
    pub branches: Option<Vec<models::GetFileBranchesItem>>,
}

impl GetFile {
    pub fn new(name: String, role: models::Role, last_modified: String, editor_type: models::EditorType, version: String, document: models::DocumentNode, components: std::collections::HashMap<String, models::Component>, component_sets: std::collections::HashMap<String, models::ComponentSet>, schema_version: f64, styles: std::collections::HashMap<String, models::Style>) -> GetFile {
        GetFile {
            name,
            role,
            last_modified,
            editor_type,
            thumbnail_url: None,
            version,
            document: Box::new(document),
            components,
            component_sets,
            schema_version,
            styles,
            link_access: None,
            main_file_key: None,
            branches: None,
        }
    }
}