summaryrefslogtreecommitdiff
path: root/lib/matrix_app_service/client.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/matrix_app_service/client.ex')
-rw-r--r--lib/matrix_app_service/client.ex8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/matrix_app_service/client.ex b/lib/matrix_app_service/client.ex
index 08407dc..8fbdc35 100644
--- a/lib/matrix_app_service/client.ex
+++ b/lib/matrix_app_service/client.ex
@@ -5,6 +5,7 @@ defmodule MatrixAppService.Client do
Library users can use the wrapped functions or call `user/1` and pass the
returned struct to Polyjuice functions.
"""
+ @behaviour MatrixAppService.ClientBehaviour
@type client_options :: {:base_url, String.t()} | MatrixAppService.Client.LowLevel.create_opts()
@@ -20,8 +21,6 @@ defmodule MatrixAppService.Client do
* `:user_id`: user ID
* `:storage`: a `t:Polyjuice.Client.Storage.t/0`
"""
- @spec client([client_options()]) ::
- Polyjuice.Client.LowLevel.t()
def client(opts \\ []) do
base_url =
Keyword.get(opts, :base_url) ||
@@ -54,7 +53,6 @@ defmodule MatrixAppService.Client do
1. `options`: see `Polyjuice.Client.Room.create_room/2`
2. `client_options`: see `client/1`
"""
- @spec create_room(Keyword.t()) :: {:ok, String.t()} | Any
def create_room(options \\ [], client_options \\ []) do
client(client_options)
|> Polyjuice.Client.Room.create_room(options)
@@ -68,7 +66,6 @@ defmodule MatrixAppService.Client do
2. `room_alias`: room alias
3. `client_options`: see `client/1`
"""
- @spec create_alias(String.t(), String.t(), client_options()) :: {:ok, String.t()} | Any
def create_alias(room_id, room_alias, client_options \\ []) do
client(client_options)
|> Polyjuice.Client.Room.create_alias(room_id, room_alias)
@@ -82,7 +79,6 @@ defmodule MatrixAppService.Client do
2. `msg`: see `Polyjuice.Client.Room.send_message/3`
3. `client_options`: see `client/1`
"""
- @spec send_message(String.t(), String.t(), client_options()) :: {:ok, String.t()} | Any
def send_message(room_id, msg, client_options \\ []) do
client(client_options)
|> Polyjuice.Client.Room.send_message(room_id, msg)
@@ -101,8 +97,6 @@ defmodule MatrixAppService.Client do
`"guest"`
2. `client_options`: see `client/1`
"""
- @spec register(Polyjuice.Client.LowLevel.register_opts(), client_options()) ::
- {:ok, String.t()} | Any
def register(opts \\ [], client_options \\ []) do
default_opts = [
inhibit_login: true,