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_room(Keyword.t(), client_options()) :: {: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() :: {:ok, String.t()} | Any @callback register(Polyjuice.Client.LowLevel.register_opts()) :: {: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 @callback get_data(Polyjuice.Client.LowLevel.t(), String.t(), String.t()) :: {:ok, map()} | any @callback modify_displayname(Polyjuice.Client.LowLevel.t(), String.t(), String.t()) :: :ok | any end