MatrixAppService.ClientBehaviour behaviour (MatrixAppService v0.3.0) View Source

Behaviour defining callbacks implemented in MatrixAppService.Client. Can be used to mock the client, for instance with mox:

TODO: example

Link to this section Summary

Link to this section Types

Specs

client_options() :: {:base_url, String.t()} | create_options()

Specs

create_options() :: [
  access_token: String.t() | nil,
  user_id: String.t() | nil,
  device_id: String.t() | nil,
  storage: Polyjuice.Client.Storage.t() | nil
]

Specs

data_format() ::
  {:data, binary(), String.t()}
  | {:file, String.t()}
  | {:url, String.t() | URI.t()}

Link to this section Callbacks

Specs

Specs

Link to this callback

create_alias(t, t, client_options)

View Source

Specs

create_alias(String.t(), String.t(), client_options()) ::
  {:ok, String.t()} | Any
Link to this callback

create_attachment_message(t, data_format, t)

View Source

Specs

create_attachment_message(
  Polyjuice.Client.LowLevel.t(),
  data_format(),
  Keyword.t()
) ::
  {:ok, Polyjuice.Client.Attachment.attachment()} | Any

Specs

create_room(Keyword.t()) :: {:ok, map()} | Any
Link to this callback

create_room(t, client_options)

View Source

Specs

create_room(Keyword.t(), client_options()) :: {:ok, map()} | Any

Specs

get_alias(String.t()) :: {:ok, String.t()} | Any
Link to this callback

get_alias(t, client_options)

View Source

Specs

get_alias(String.t(), client_options()) :: {:ok, String.t()} | Any

Specs

get_data(String.t(), String.t()) :: {:ok, map()} | any()
Link to this callback

get_data(t, t, client_options)

View Source

Specs

get_data(String.t(), String.t(), client_options()) :: {:ok, map()} | any()

Specs

get_profile(String.t()) :: {:ok, map()} | any()
Link to this callback

get_profile(t, client_options)

View Source

Specs

get_profile(String.t(), client_options()) :: {:ok, map()} | any()

Specs

join(String.t()) :: :ok | any()

Specs

join(String.t(), client_options()) :: :ok | any()

Specs

put_avatar_url(String.t(), String.t()) :: :ok | any()
Link to this callback

put_avatar_url(t, t, client_options)

View Source

Specs

put_avatar_url(String.t(), String.t(), client_options()) :: :ok | any()

Specs

put_data(String.t(), String.t(), map()) :: {:ok, map()} | any()
Link to this callback

put_data(t, t, map, client_options)

View Source

Specs

put_data(String.t(), String.t(), map(), client_options()) ::
  {:ok, map()} | any()

Specs

put_displayname(String.t(), String.t()) :: :ok | any()
Link to this callback

put_displayname(t, t, client_options)

View Source

Specs

put_displayname(String.t(), String.t(), client_options()) :: :ok | any()

Specs

redact_message(String.t(), String.t(), String.t()) :: {:ok, String.t()} | Any
Link to this callback

redact_message(t, t, t, client_options)

View Source

Specs

redact_message(String.t(), String.t(), String.t(), client_options()) ::
  {:ok, String.t()} | Any

Specs

register() :: {:ok, String.t()} | Any

Specs

register(list()) :: {:ok, String.t()} | Any
Link to this callback

register(list, client_options)

View Source

Specs

register(list(), client_options()) :: {:ok, String.t()} | Any

Specs

search_user(String.t(), integer()) :: {:ok, String.t()} | Any
Link to this callback

search_user(t, integer, client_options)

View Source

Specs

search_user(String.t(), integer(), client_options()) :: {:ok, String.t()} | Any

Specs

send_message(String.t(), String.t()) :: {:ok, String.t()} | Any
Link to this callback

send_message(t, t, client_options)

View Source

Specs

send_message(String.t(), String.t(), client_options()) ::
  {:ok, String.t()} | Any

Specs

upload(binary(), Keyword.t()) :: {:ok, String.t()} | Any
Link to this callback

upload(binary, t, client_options)

View Source

Specs

upload(binary(), Keyword.t(), client_options()) :: {:ok, String.t()} | Any