slack_morphism/api/
stars.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
67
68
69
//!
//! Support for Slack Stars API methods
//!

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

use crate::models::*;
use crate::ratectl::*;
use crate::*;
use futures::future::{BoxFuture, FutureExt};
use std::collections::HashSet;

impl<'a, SCHC> SlackClientSession<'a, SCHC>
where
    SCHC: SlackClientHttpConnector + Send,
{
    ///
    /// https://api.slack.com/methods/stars.add
    ///
    pub async fn stars_add(
        &self,
        req: &SlackApiStarsAddRequest,
    ) -> ClientResult<SlackApiStarsAddResponse> {
        self.http_session_api
            .http_post("stars.add", req, Some(&SLACK_TIER2_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/stars.remove
    ///
    pub async fn stars_remove(
        &self,
        req: &SlackApiStarsRemoveRequest,
    ) -> ClientResult<SlackApiStarsRemoveResponse> {
        self.http_session_api
            .http_post("stars.remove", req, Some(&SLACK_TIER2_METHOD_CONFIG))
            .await
    }
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackApiStarsAddRequest {
    pub channel: Option<SlackChannelId>,
    pub file: Option<SlackFileId>,
    pub file_comment: Option<SlackFileCommentId>,
    pub timestamp: Option<SlackTs>,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackApiStarsAddResponse {}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackApiStarsRemoveRequest {
    pub channel: Option<SlackChannelId>,
    pub file: Option<SlackFileId>,
    pub file_comment: Option<SlackFileCommentId>,
    pub timestamp: Option<SlackTs>,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackApiStarsRemoveResponse {}