summaryrefslogtreecommitdiff
path: root/lib/matrix_app_service/client_behaviour.ex
blob: cf562865fdfde06e722ab02440b774cd707c80f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
defmodule MatrixAppService.ClientBehaviour do
  @moduledoc """
  Behaviour defining callbacks implemented in `MatrixAppService.Client`. Can be used to mock the client, for instance with `mox`:

  TODO: example
  """

  @type client_options :: {:base_url, String.t()} | MatrixAppService.Client.LowLevel.create_opts()

  @callback client() ::
              Polyjuice.Client.LowLevel.t()
  @callback client([client_options()]) ::
              Polyjuice.Client.LowLevel.t()
  @callback create_room(Keyword.t()) :: {:ok, String.t()} | Any
  @callback create_alias(String.t(), String.t(), client_options()) :: {:ok, String.t()} | Any
  @callback send_message(String.t(), String.t(), client_options()) :: {:ok, String.t()} | Any
  @callback register(Polyjuice.Client.LowLevel.register_opts(), client_options()) ::
              {:ok, String.t()} | Any
  @callback get_profile(Polyjuice.Client.LowLevel.t(), String.t()) :: {:ok, map()} | any
end