-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for stars events (#241)
Add support for `star_added` and `star_removed` Slack events. It has now been renamed "saved for later" in the Slack UI.
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 { | ||
message: SlackHistoryMessage, | ||
channel: SlackChannelId, | ||
date_create: SlackDateTime, | ||
} | ||
|
||
#[skip_serializing_none] | ||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)] | ||
pub struct SlackStarsItemFile { | ||
file: SlackFile, | ||
channel: SlackChannelId, | ||
date_create: SlackDateTime, | ||
} | ||
|
||
#[skip_serializing_none] | ||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)] | ||
pub struct SlackStarsItemFileComment { | ||
file: SlackFile, | ||
comment: String, | ||
channel: SlackChannelId, | ||
date_create: SlackDateTime, | ||
} | ||
|
||
#[skip_serializing_none] | ||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)] | ||
pub struct SlackStarsItemChannel { | ||
channel: SlackChannelId, | ||
date_create: SlackDateTime, | ||
} | ||
|
||
#[skip_serializing_none] | ||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)] | ||
pub struct SlackStarsItemIm { | ||
channel: SlackChannelId, | ||
date_create: SlackDateTime, | ||
} | ||
|
||
#[skip_serializing_none] | ||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)] | ||
pub struct SlackStarsItemGroup { | ||
group: SlackChannelId, | ||
date_create: SlackDateTime, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters