Automaton v0.1.0 Automaton.Adapter behaviour View Source

Defines an adapter and it’s specifications

Link to this section Summary

Callbacks

Parses the webhook response into a Message

Sends a message to the messaging platform with the given config

Link to this section Types

Link to this type message_text() View Source
message_text() :: String.t
Link to this type sender_id() View Source
sender_id() :: String.t

Link to this section Callbacks

Link to this callback parse(response) View Source
parse(response) ::
  {:ok, sender_id, message_text, context} |
  {:error, term}

Parses the webhook response into a Message

Link to this callback send(sender_id, message_text, context, config) View Source
send(sender_id, message_text, context, config) ::
  :ok |
  {:error, term}

Sends a message to the messaging platform with the given config