mattermost_rust_client/models/create_channel_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 CreateChannelRequest {
16 /// The team ID of the team to create the channel on
17 #[serde(rename = "team_id")]
18 pub team_id: String,
19 /// The unique handle for the channel, will be present in the channel URL
20 #[serde(rename = "name")]
21 pub name: String,
22 /// The non-unique UI name for the channel
23 #[serde(rename = "display_name")]
24 pub display_name: String,
25 /// A short description of the purpose of the channel
26 #[serde(rename = "purpose", skip_serializing_if = "Option::is_none")]
27 pub purpose: Option<String>,
28 /// Markdown-formatted text to display in the header of the channel
29 #[serde(rename = "header", skip_serializing_if = "Option::is_none")]
30 pub header: Option<String>,
31 /// 'O' for a public channel, 'P' for a private channel
32 #[serde(rename = "type")]
33 pub r#type: String,
34}
35
36impl CreateChannelRequest {
37 pub fn new(team_id: String, name: String, display_name: String, r#type: String) -> CreateChannelRequest {
38 CreateChannelRequest {
39 team_id,
40 name,
41 display_name,
42 purpose: None,
43 header: None,
44 r#type,
45 }
46 }
47}
48
49