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 ]
Link to this section Callbacks
@callback client() :: Polyjuice.Client.LowLevel.t()
@callback client([client_options()]) :: Polyjuice.Client.LowLevel.t()
@callback create_alias(String.t(), String.t(), client_options()) :: {:ok, String.t()} | any()
@callback create_attachment_message(data_format(), Keyword.t(), client_options()) :: Polyjuice.Client.Attachment.attachment()
@callback create_room(Keyword.t(), client_options()) :: {:ok, map()} | any()
@callback get_alias(String.t(), client_options()) :: {:ok, String.t()} | any()
@callback get_data(String.t(), String.t(), client_options()) :: {:ok, map()} | any()
@callback get_profile(String.t(), client_options()) :: {:ok, map()} | any()
@callback join(String.t(), client_options()) :: :ok | any()
@callback put_avatar_url(String.t(), String.t(), client_options()) :: :ok | any()
@callback put_displayname(String.t(), String.t(), client_options()) :: :ok | any()
@callback register(list(), client_options()) :: {:ok, String.t()} | any()
@callback search_user(String.t(), integer(), client_options()) :: {:ok, String.t()} | any()
@callback send_message(String.t(), String.t(), client_options()) :: {:ok, String.t()} | any()
@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(), client_options()) :: {:ok, String.t()} | any()