Skip to main content

mattermost_client/openapi/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#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)]
12pub struct CreatePostRequest {
13    /// The channel ID to post in
14    #[serde(rename = "channel_id")]
15    pub channel_id: String,
16    /// The message contents, can be formatted with Markdown
17    #[serde(rename = "message")]
18    pub message: String,
19    /// The post ID to comment on
20    #[serde(rename = "root_id", skip_serializing_if = "Option::is_none")]
21    pub root_id: Option<String>,
22    /// 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.
23    #[serde(rename = "file_ids", skip_serializing_if = "Option::is_none")]
24    pub file_ids: Option<Vec<String>>,
25    /// A general JSON property bag to attach to the post
26    #[serde(rename = "props", skip_serializing_if = "Option::is_none")]
27    pub props: Option<serde_json::Value>,
28    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
29    pub metadata: Option<Box<crate::openapi::models::CreatePostRequestMetadata>>,
30}
31
32impl CreatePostRequest {
33    pub fn new(channel_id: String, message: String) -> CreatePostRequest {
34        CreatePostRequest {
35            channel_id,
36            message,
37            root_id: None,
38            file_ids: None,
39            props: None,
40            metadata: None,
41        }
42    }
43}