mattermost_client/openapi/models/
file_info.rs

1/*
2 * Mattermost API Reference
3 *
4 * There is also a work-in-progress [Postman API reference](https://documenter.getpostman.com/view/4508214/RW8FERUn).
5 *
6 * The version of the OpenAPI document: 4.0.0
7 * Contact: feedback@mattermost.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)]
12pub struct FileInfo {
13    /// The unique identifier for this file
14    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
15    pub id: Option<String>,
16    /// The ID of the user that uploaded this file
17    #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
18    pub user_id: Option<String>,
19    /// If this file is attached to a post, the ID of that post
20    #[serde(rename = "post_id", skip_serializing_if = "Option::is_none")]
21    pub post_id: Option<String>,
22    /// The time in milliseconds a file was created
23    #[serde(rename = "create_at", skip_serializing_if = "Option::is_none")]
24    pub create_at: Option<i64>,
25    /// The time in milliseconds a file was last updated
26    #[serde(rename = "update_at", skip_serializing_if = "Option::is_none")]
27    pub update_at: Option<i64>,
28    /// The time in milliseconds a file was deleted
29    #[serde(rename = "delete_at", skip_serializing_if = "Option::is_none")]
30    pub delete_at: Option<i64>,
31    /// The name of the file
32    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33    pub name: Option<String>,
34    /// The extension at the end of the file name
35    #[serde(rename = "extension", skip_serializing_if = "Option::is_none")]
36    pub extension: Option<String>,
37    /// The size of the file in bytes
38    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
39    pub size: Option<i32>,
40    /// The MIME type of the file
41    #[serde(rename = "mime_type", skip_serializing_if = "Option::is_none")]
42    pub mime_type: Option<String>,
43    /// If this file is an image, the width of the file
44    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
45    pub width: Option<i32>,
46    /// If this file is an image, the height of the file
47    #[serde(rename = "height", skip_serializing_if = "Option::is_none")]
48    pub height: Option<i32>,
49    /// If this file is an image, whether or not it has a preview-sized version
50    #[serde(rename = "has_preview_image", skip_serializing_if = "Option::is_none")]
51    pub has_preview_image: Option<bool>,
52}
53
54impl FileInfo {
55    pub fn new() -> FileInfo {
56        FileInfo {
57            id: None,
58            user_id: None,
59            post_id: None,
60            create_at: None,
61            update_at: None,
62            delete_at: None,
63            name: None,
64            extension: None,
65            size: None,
66            mime_type: None,
67            width: None,
68            height: None,
69            has_preview_image: None,
70        }
71    }
72}