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

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

@type client_options() :: {:base_url, String.t()} | create_options()
@type create_options() :: [
  access_token: String.t() | nil,
  user_id: String.t() | nil,
  device_id: String.t() | nil,
  storage: Polyjuice.Client.Storage.t() | nil
]
@type data_format() ::
  {:data, binary(), String.t()}
  | {:file, String.t()}
  | {:url, String.t() | URI.t()}

Link to this section Callbacks

@callback client() :: Polyjuice.Client.LowLevel.t()
@callback client([client_options()]) :: Polyjuice.Client.LowLevel.t()
Link to this callback

create_alias(t, t, client_options)

View Source
@callback create_alias(String.t(), String.t(), client_options()) ::
  {:ok, String.t()} | any()
Link to this callback

create_attachment_message(data_format, t, client_options)

View Source
@callback create_attachment_message(data_format(), Keyword.t(), client_options()) ::
  Polyjuice.Client.Attachment.attachment()
@callback create_room(Keyword.t()) :: {:ok, map()} | any()
Link to this callback

create_room(t, client_options)

View Source
@callback create_room(Keyword.t(), client_options()) :: {:ok, map()} | any()
@callback get_alias(String.t()) :: {:ok, String.t()} | any()
Link to this callback

get_alias(t, client_options)

View Source
@callback get_alias(String.t(), client_options()) :: {:ok, String.t()} | any()
@callback get_data(String.t(), String.t()) :: {:ok, map()} | any()
Link to this callback

get_data(t, t, client_options)

View Source
@callback get_data(String.t(), String.t(), client_options()) :: {:ok, map()} | any()
@callback get_profile(String.t()) :: {:ok, map()} | any()
Link to this callback

get_profile(t, client_options)

View Source
@callback get_profile(String.t(), client_options()) :: {:ok, map()} | any()
@callback get_state(String.t(), String.t() | nil, String.t()) :: {:ok, String.t()} | any()
Link to this callback

get_state(t, arg2, t, client_options)

View Source
@callback get_state(String.t(), String.t() | nil, String.t(), client_options()) ::
  {:ok, String.t()} | any()
@callback join(String.t()) :: :ok | any()
@callback join(String.t(), client_options()) :: :ok | any()
@callback put_avatar_url(String.t(), String.t()) :: :ok | any()
Link to this callback

put_avatar_url(t, t, client_options)

View Source
@callback put_avatar_url(String.t(), String.t(), client_options()) :: :ok | any()
@callback put_data(String.t(), String.t(), map()) :: {:ok, map()} | any()
Link to this callback

put_data(t, t, map, client_options)

View Source
@callback put_data(String.t(), String.t(), map(), client_options()) ::
  {:ok, map()} | any()
@callback put_displayname(String.t(), String.t()) :: :ok | any()
Link to this callback

put_displayname(t, t, client_options)

View Source
@callback put_displayname(String.t(), String.t(), client_options()) :: :ok | any()
@callback 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
@callback redact_message(String.t(), String.t(), String.t(), client_options()) ::
  {:ok, String.t()} | any()
@callback register() :: {:ok, String.t()} | any()
@callback register(list()) :: {:ok, String.t()} | any()
Link to this callback

register(list, client_options)

View Source
@callback register(list(), client_options()) :: {:ok, String.t()} | any()
@callback search_user(String.t(), integer()) :: {:ok, String.t()} | any()
Link to this callback

search_user(t, integer, client_options)

View Source
@callback search_user(String.t(), integer(), client_options()) ::
  {:ok, String.t()} | any()
@callback send_message(String.t(), String.t()) :: {:ok, String.t()} | any()
Link to this callback

send_message(t, t, client_options)

View Source
@callback send_message(String.t(), String.t(), client_options()) ::
  {:ok, String.t()} | any()
Link to this callback

send_state_event(t, t, t, event_content)

View Source
@callback send_state_event(
  String.t(),
  String.t(),
  String.t(),
  Polyjuice.Util.event_content()
) ::
  {:ok, String.t()} | any()
Link to this callback

send_state_event(t, t, t, event_content, client_options)

View Source
@callback send_state_event(
  String.t(),
  String.t(),
  String.t(),
  Polyjuice.Util.event_content(),
  client_options()
) :: {:ok, String.t()} | any()
@callback upload(binary(), Keyword.t()) :: {:ok, String.t()} | any()
Link to this callback

upload(binary, t, client_options)

View Source
@callback upload(binary(), Keyword.t(), client_options()) :: {:ok, String.t()} | any()