mattermost_rust_client/models/
create_incoming_webhook_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 CreateIncomingWebhookRequest {
16    /// The ID of a public channel or private group that receives the webhook payloads.
17    #[serde(rename = "channel_id")]
18    pub channel_id: String,
19    /// The ID of the owner of the webhook if different than the requester. Required for [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode).
20    #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
21    pub user_id: Option<String>,
22    /// The display name for this incoming webhook
23    #[serde(rename = "display_name", skip_serializing_if = "Option::is_none")]
24    pub display_name: Option<String>,
25    /// The description for this incoming webhook
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    /// The username this incoming webhook will post as.
29    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
30    pub username: Option<String>,
31    /// The profile picture this incoming webhook will use when posting.
32    #[serde(rename = "icon_url", skip_serializing_if = "Option::is_none")]
33    pub icon_url: Option<String>,
34}
35
36impl CreateIncomingWebhookRequest {
37    pub fn new(channel_id: String) -> CreateIncomingWebhookRequest {
38        CreateIncomingWebhookRequest {
39            channel_id,
40            user_id: None,
41            display_name: None,
42            description: None,
43            username: None,
44            icon_url: None,
45        }
46    }
47}
48
49