Skip to main content

SlackApi

Trait SlackApi 

Source
pub trait SlackApi: Send + Sync {
Show 18 methods // Required methods fn auth_test<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<AuthTest, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_conversations<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackConversation>, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn history<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, channel: &'life1 str, oldest: Option<&'life2 str>, newest: Option<&'life3 str>, limit: u32, cursor: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<MessagePage, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait; fn replies<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, channel: &'life1 str, ts: &'life2 str, oldest: Option<&'life3 str>, limit: u32, cursor: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<MessagePage, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait; fn post_message<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, channel: &'life1 str, text: &'life2 str, thread_ts: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<PostedMessage, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn update_message<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, channel: &'life1 str, ts: &'life2 str, text: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<(), SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn delete_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, channel: &'life1 str, ts: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, channel: &'life1 str, ts: &'life2 str, name: &'life3 str, add: bool, ) -> Pin<Box<dyn Future<Output = Result<(), SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn get_bytes<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn post_bytes<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, body: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn file_info<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<SlackFile, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_upload_url<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, length: usize, ) -> Pin<Box<dyn Future<Output = Result<(String, String), SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn complete_upload<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, file_id: &'life1 str, channel: &'life2 str, thread_ts: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackFile>, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn search_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, count: u32, cursor: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<SearchPage, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn user_info<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<SlackUser, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_users<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackUser>, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pins<'life0, 'life1, 'async_trait>( &'life0 self, channel: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackPin>, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn bookmarks<'life0, 'life1, 'async_trait>( &'life0 self, channel: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackBookmark>, SlackError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}
Expand description

The Web API calls this connector makes, behind a trait so a sweep or an outbound call can be driven from a test double instead of a live workspace.

Public because forge-workspace holds one and cannot store a trait it cannot name, the same reason SlackHost is public. It abstracts this one connector’s own surface; it is not a trait shared between connectors.

Required Methods§

Source

fn auth_test<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<AuthTest, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Who the token belongs to; the boot probe’s only call.

Source

fn list_conversations<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackConversation>, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn history<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, channel: &'life1 str, oldest: Option<&'life2 str>, newest: Option<&'life3 str>, limit: u32, cursor: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<MessagePage, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source

fn replies<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, channel: &'life1 str, ts: &'life2 str, oldest: Option<&'life3 str>, limit: u32, cursor: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<MessagePage, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source

fn post_message<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, channel: &'life1 str, text: &'life2 str, thread_ts: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<PostedMessage, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Post one message, as a root or into an existing thread. Returns the posted message’s ts, the handle a reply, an edit, a delete and a reaction all take, and the channel it landed in - a request can address a user id or a channel name instead of the conversation id.

Source

fn update_message<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, channel: &'life1 str, ts: &'life2 str, text: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<(), SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Replace the text of one of the authenticated user’s own messages.

Source

fn delete_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, channel: &'life1 str, ts: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete one of the authenticated user’s own messages.

Source

fn set_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, channel: &'life1 str, ts: &'life2 str, name: &'life3 str, add: bool, ) -> Pin<Box<dyn Future<Output = Result<(), SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Add or remove one reaction on a message.

Source

fn get_bytes<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

GET an absolute URL with the bearer attached, for a private file.

Source

fn post_bytes<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, body: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

POST raw bytes to an absolute pre-signed URL, with no bearer.

Source

fn file_info<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<SlackFile, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

files.info for one file id.

Source

fn get_upload_url<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, length: usize, ) -> Pin<Box<dyn Future<Output = Result<(String, String), SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

files.getUploadURLExternal: the pre-signed URL to POST the bytes to, plus the file id the completion call needs.

Source

fn complete_upload<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, file_id: &'life1 str, channel: &'life2 str, thread_ts: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackFile>, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

files.completeUploadExternal, which can be called once only. Returns the files it reports: when Slack fills their shares, that already names the message the upload was posted as.

Source

fn search_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, count: u32, cursor: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<SearchPage, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

search.messages, always timestamp-ordered. The cursor follows a previous page when one sweep has more hits than one page holds.

Source

fn user_info<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<SlackUser, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

users.info for one user id.

Source

fn list_users<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackUser>, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every member in the workspace. Deactivated members are included so the caller decides what a row means.

Source

fn pins<'life0, 'life1, 'async_trait>( &'life0 self, channel: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackPin>, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

pins.list for one conversation.

Source

fn bookmarks<'life0, 'life1, 'async_trait>( &'life0 self, channel: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlackBookmark>, SlackError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

bookmarks.list for one conversation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§