Jido.Chat.Slack.Transport behaviour (Jido Chat Slack v1.0.0)

Copy Markdown View Source

Transport contract for Slack Web API operations.

Summary

Types

api_result()

@type api_result() :: {:ok, map() | boolean()} | {:error, term()}

Callbacks

add_reaction(channel_id, message_id, emoji, opts)

@callback add_reaction(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  emoji :: String.t(),
  opts :: keyword()
) :: api_result()

delete_message(channel_id, message_id, opts)

@callback delete_message(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  opts :: keyword()
) :: api_result()

edit_message(channel_id, message_id, text, opts)

@callback edit_message(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  text :: String.t(),
  opts :: keyword()
) :: api_result()

fetch_channel_messages(channel_id, opts)

@callback fetch_channel_messages(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

fetch_message(channel_id, message_id, opts)

@callback fetch_message(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  opts :: keyword()
) :: api_result()

fetch_messages(channel_id, opts)

@callback fetch_messages(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

fetch_metadata(channel_id, opts)

@callback fetch_metadata(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

fetch_thread(channel_id, opts)

@callback fetch_thread(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

list_threads(channel_id, opts)

@callback list_threads(channel_id :: String.t() | integer(), opts :: keyword()) ::
  api_result()

open_dm(user_id, opts)

@callback open_dm(user_id :: String.t() | integer(), opts :: keyword()) ::
  {:ok, String.t() | integer()} | {:error, term()}

open_modal(trigger_id, payload, opts)

@callback open_modal(trigger_id :: String.t(), payload :: map(), opts :: keyword()) ::
  api_result()

post_ephemeral(channel_id, user_id, text, opts)

@callback post_ephemeral(
  channel_id :: String.t() | integer(),
  user_id :: String.t() | integer(),
  text :: String.t(),
  opts :: keyword()
) :: api_result()

remove_reaction(channel_id, message_id, emoji, opts)

@callback remove_reaction(
  channel_id :: String.t() | integer(),
  message_id :: String.t() | integer(),
  emoji :: String.t(),
  opts :: keyword()
) :: api_result()

send_file(channel_id, upload, opts)

@callback send_file(
  channel_id :: String.t() | integer(),
  upload :: Jido.Chat.FileUpload.t(),
  opts :: keyword()
) :: api_result()

send_message(channel_id, text, opts)

@callback send_message(
  channel_id :: String.t() | integer(),
  text :: String.t(),
  opts :: keyword()
) :: api_result()