Skip to main content

mattermost_rust_client/models/
post_metadata_embeds_inner.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
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct PostMetadataEmbedsInner {
16    /// The type of content that is embedded in this point.
17    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
18    pub r#type: Option<RHashType>,
19    /// The URL of the embedded content, if one exists.
20    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
21    pub url: Option<String>,
22    /// Any additional information about the embedded content. Only used at this time to store OpenGraph metadata. This field will be null for non-OpenGraph embeds. 
23    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
24    pub data: Option<serde_json::Value>,
25}
26
27impl PostMetadataEmbedsInner {
28    pub fn new() -> PostMetadataEmbedsInner {
29        PostMetadataEmbedsInner {
30            r#type: None,
31            url: None,
32            data: None,
33        }
34    }
35}
36
37/// The type of content that is embedded in this point.
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum RHashType {
40    #[serde(rename = "image")]
41    Image,
42    #[serde(rename = "message_attachment")]
43    MessageAttachment,
44    #[serde(rename = "opengraph")]
45    Opengraph,
46    #[serde(rename = "link")]
47    Link,
48}
49
50impl Default for RHashType {
51    fn default() -> RHashType {
52        Self::Image
53    }
54}
55