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