mattermost_client/openapi/models/
post_metadata.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/// PostMetadata : Additional information used to display a post.
12
13#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)]
14pub struct PostMetadata {
15    /// Information about content embedded in the post including OpenGraph previews, image link previews, and message attachments. This field will be null if the post does not contain embedded content.
16    #[serde(rename = "embeds", skip_serializing_if = "Option::is_none")]
17    pub embeds: Option<Vec<crate::openapi::models::PostMetadataEmbedsInner>>,
18    /// The custom emojis that appear in this point or have been used in reactions to this post. This field will be null if the post does not contain custom emojis.
19    #[serde(rename = "emojis", skip_serializing_if = "Option::is_none")]
20    pub emojis: Option<Vec<crate::openapi::models::Emoji>>,
21    /// The FileInfo objects for any files attached to the post. This field will be null if the post does not have any file attachments.
22    #[serde(rename = "files", skip_serializing_if = "Option::is_none")]
23    pub files: Option<Vec<crate::openapi::models::FileInfo>>,
24    /// An object mapping the URL of an external image to an object containing the dimensions of that image. This field will be null if the post or its embedded content does not reference any external images.
25    #[serde(rename = "images", skip_serializing_if = "Option::is_none")]
26    pub images: Option<
27        ::std::collections::HashMap<String, crate::openapi::models::PostMetadataImagesInner>,
28    >,
29    /// Any reactions made to this point. This field will be null if no reactions have been made to this post.
30    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
31    pub reactions: Option<Vec<crate::openapi::models::Reaction>>,
32    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
33    pub priority: Option<Box<crate::openapi::models::PostMetadataPriority>>,
34    /// Any acknowledgements made to this point.
35    #[serde(rename = "acknowledgements", skip_serializing_if = "Option::is_none")]
36    pub acknowledgements: Option<Vec<crate::openapi::models::PostAcknowledgement>>,
37}
38
39impl PostMetadata {
40    /// Additional information used to display a post.
41    pub fn new() -> PostMetadata {
42        PostMetadata {
43            embeds: None,
44            emojis: None,
45            files: None,
46            images: None,
47            reactions: None,
48            priority: None,
49            acknowledgements: None,
50        }
51    }
52}