mattermost_rust_client/models/
create_post_request.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 CreatePostRequest {
16    /// The channel ID to post in
17    #[serde(rename = "channel_id")]
18    pub channel_id: String,
19    /// The message contents, can be formatted with Markdown
20    #[serde(rename = "message")]
21    pub message: String,
22    /// The post ID to comment on
23    #[serde(rename = "root_id", skip_serializing_if = "Option::is_none")]
24    pub root_id: Option<String>,
25    /// A list of file IDs to associate with the post. Note that posts are limited to 5 files maximum. Please use additional posts for more files.
26    #[serde(rename = "file_ids", skip_serializing_if = "Option::is_none")]
27    pub file_ids: Option<Vec<String>>,
28    /// A general JSON property bag to attach to the post
29    #[serde(rename = "props", skip_serializing_if = "Option::is_none")]
30    pub props: Option<serde_json::Value>,
31}
32
33impl CreatePostRequest {
34    pub fn new(channel_id: String, message: String) -> CreatePostRequest {
35        CreatePostRequest {
36            channel_id,
37            message,
38            root_id: None,
39            file_ids: None,
40            props: None,
41        }
42    }
43}
44
45