1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Mattermost API Reference
*
* There is also a work-in-progress [Postman API reference](https://documenter.getpostman.com/view/4508214/RW8FERUn).
*
* The version of the OpenAPI document: 4.0.0
* Contact: feedback@mattermost.com
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, serde::Serialize, serde::Deserialize)]
pub struct AddChecklistItemRequest {
/// The title of the checklist item.
#[serde(rename = "title")]
pub title: String,
/// The state of the checklist item. An empty string means that the item is not done.
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<State>,
/// The timestamp for the latest modification of the item's state, formatted as the number of milliseconds since the Unix epoch. It equals 0 if the item was never modified.
#[serde(rename = "state_modified", skip_serializing_if = "Option::is_none")]
pub state_modified: Option<i64>,
/// The identifier of the user that has been assigned to complete this item. If the item has no assignee, this is an empty string.
#[serde(rename = "assignee_id", skip_serializing_if = "Option::is_none")]
pub assignee_id: Option<String>,
/// The timestamp for the latest modification of the item's assignee, formatted as the number of milliseconds since the Unix epoch. It equals 0 if the item never got an assignee.
#[serde(rename = "assignee_modified", skip_serializing_if = "Option::is_none")]
pub assignee_modified: Option<i64>,
/// The slash command associated with this item. If the item has no slash command associated, this is an empty string
#[serde(rename = "command", skip_serializing_if = "Option::is_none")]
pub command: Option<String>,
/// The timestamp for the latest execution of the item's command, formatted as the number of milliseconds since the Unix epoch. It equals 0 if the command was never executed.
#[serde(rename = "command_last_run", skip_serializing_if = "Option::is_none")]
pub command_last_run: Option<i64>,
/// A detailed description of the checklist item, formatted with Markdown.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
impl AddChecklistItemRequest {
pub fn new(title: String) -> AddChecklistItemRequest {
AddChecklistItemRequest {
title,
state: None,
state_modified: None,
assignee_id: None,
assignee_modified: None,
command: None,
command_last_run: None,
description: None,
}
}
}
/// The state of the checklist item. An empty string means that the item is not done.
#[derive(
Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Serialize, serde::Deserialize,
)]
pub enum State {
#[serde(rename = "")]
Empty,
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "closed")]
Closed,
}
impl Default for State {
fn default() -> State {
Self::Empty
}
}