slack_morphism/models/common/
star.rs

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
use crate::*;

use rsb_derive::Builder;
use rvstruct::ValueStruct;
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[serde(tag = "type")]
#[serde(rename_all = "lowercase")]
#[allow(clippy::large_enum_variant)]
pub enum SlackStarsItem {
    Message(SlackStarsItemMessage),
    File(SlackStarsItemFile),
    #[serde(rename = "file_comment")]
    FileComment(SlackStarsItemFileComment),
    Channel(SlackStarsItemChannel),
    Im(SlackStarsItemIm),
    Group(SlackStarsItemGroup),
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackStarsItemMessage {
    pub message: SlackHistoryMessage,
    pub channel: SlackChannelId,
    pub date_create: SlackDateTime,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackStarsItemFile {
    pub file: SlackFile,
    pub channel: SlackChannelId,
    pub date_create: SlackDateTime,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackStarsItemFileComment {
    pub file: SlackFile,
    pub comment: SlackFileCommentId,
    pub channel: SlackChannelId,
    pub date_create: SlackDateTime,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackStarsItemChannel {
    pub channel: SlackChannelId,
    pub date_create: SlackDateTime,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackStarsItemIm {
    pub channel: SlackChannelId,
    pub date_create: SlackDateTime,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackStarsItemGroup {
    pub group: SlackChannelId,
    pub date_create: SlackDateTime,
}