messenger_bot_store v0.0.10 MessengerBotStore

The Model context.

Link to this section Summary

Functions

Returns an %Ecto.Changeset{} for tracking conversation changes

Returns an %Ecto.Changeset{} for tracking error changes

Returns an %Ecto.Changeset{} for tracking message_report changes

Returns an %Ecto.Changeset{} for tracking referral changes

Returns an %Ecto.Changeset{} for tracking user changes

Creates a conversation

Creates a error

Creates a message_report

Creates a referral

Creates a user

Deletes a Conversation

Deletes a Error

Deletes a MessageReport

Deletes a Referral

Deletes a User

Gets a single conversation

Gets a single error

Gets a single message_report

Gets a single referral

Gets a single user

Returns the list of conversations

Returns the list of errors

Returns the list of message_reports

Returns the list of referrals

Returns the list of users

Updates delivered_at column of user’s conversations

Updates read_at column of user’s conversations

Updates a error

Updates a user

Link to this section Functions

Link to this function change_conversation(conversation)

Returns an %Ecto.Changeset{} for tracking conversation changes.

Examples

iex> change_conversation(conversation)
%Ecto.Changeset{source: %Conversation{}}
Link to this function change_error(error)

Returns an %Ecto.Changeset{} for tracking error changes.

Examples

iex> change_error(error)
%Ecto.Changeset{source: %Error{}}
Link to this function change_message_report(message_report)

Returns an %Ecto.Changeset{} for tracking message_report changes.

Examples

iex> change_message_report(message_report)
%Ecto.Changeset{source: %MessageReport{}}
Link to this function change_referral(referral)

Returns an %Ecto.Changeset{} for tracking referral changes.

Examples

iex> change_referral(referral)
%Ecto.Changeset{source: %Referral{}}
Link to this function change_user(user)

Returns an %Ecto.Changeset{} for tracking user changes.

Examples

iex> change_user(user)
%Ecto.Changeset{source: %User{}}
Link to this function create_conversation(attrs \\ %{})

Creates a conversation.

Examples

iex> create_conversation(%{field: value})
{:ok, %Conversation{}}

iex> create_conversation(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function create_error(attrs \\ %{})

Creates a error.

Examples

iex> create_error(%{field: value})
{:ok, %Error{}}

iex> create_error(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function create_message_report(attrs \\ %{})

Creates a message_report.

Examples

iex> create_message_report(%{field: value})
{:ok, %MessageReport{}}

iex> create_message_report(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function create_referral(attrs \\ %{})

Creates a referral.

Examples

iex> create_referral(%{field: value})
{:ok, %Referral{}}

iex> create_referral(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function create_user(attrs \\ %{})

Creates a user.

Examples

iex> create_user(%{field: value})
{:ok, %User{}}

iex> create_user(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function delete_conversation(conversation)

Deletes a Conversation.

Examples

iex> delete_conversation(conversation)
{:ok, %Conversation{}}

iex> delete_conversation(conversation)
{:error, %Ecto.Changeset{}}
Link to this function delete_error(error)

Deletes a Error.

Examples

iex> delete_error(error)
{:ok, %Error{}}

iex> delete_error(error)
{:error, %Ecto.Changeset{}}
Link to this function delete_message_report(message_report)

Deletes a MessageReport.

Examples

iex> delete_message_report(message_report)
{:ok, %MessageReport{}}

iex> delete_message_report(message_report)
{:error, %Ecto.Changeset{}}
Link to this function delete_referral(referral)

Deletes a Referral.

Examples

iex> delete_referral(referral)
{:ok, %Referral{}}

iex> delete_referral(referral)
{:error, %Ecto.Changeset{}}
Link to this function delete_user(user)

Deletes a User.

Examples

iex> delete_user(user)
{:ok, %User{}}

iex> delete_user(user)
{:error, %Ecto.Changeset{}}
Link to this function get_conversation!(mid)

Gets a single conversation.

Raises Ecto.NoResultsError if the Conversation does not exist.

Examples

iex> get_conversation!(123)
%Conversation{}

iex> get_conversation!(456)
** (Ecto.NoResultsError)

Gets a single error.

Raises Ecto.NoResultsError if the Error does not exist.

Examples

iex> get_error!(123)
%Error{}

iex> get_error!(456)
** (Ecto.NoResultsError)
Link to this function get_message_report!(id)

Gets a single message_report.

Raises Ecto.NoResultsError if the Message report does not exist.

Examples

iex> get_message_report!(123)
%MessageReport{}

iex> get_message_report!(456)
** (Ecto.NoResultsError)
Link to this function get_referral!(id)

Gets a single referral.

Raises Ecto.NoResultsError if the Referral does not exist.

Examples

iex> get_referral!(123)
%Referral{}

iex> get_referral!(456)
** (Ecto.NoResultsError)
Link to this function get_user(external_id)

Gets a single user.

Raises Ecto.NoResultsError if the User does not exist.

Examples

iex> get_user!(123)
%User{}

iex> get_user!(456)
** (Ecto.NoResultsError)
Link to this function list_conversations()

Returns the list of conversations.

Examples

iex> list_conversations()
[%Conversation{}, ...]

Returns the list of errors.

Examples

iex> list_errors()
[%Error{}, ...]
Link to this function list_message_reports()

Returns the list of message_reports.

Examples

iex> list_message_reports()
[%MessageReport{}, ...]
Link to this function list_referrals()

Returns the list of referrals.

Examples

iex> list_referrals()
[%Referral{}, ...]

Returns the list of users.

Examples

iex> list_users()
[%User{}, ...]
Link to this function update_conversation(conversation, attrs)

Updates a conversation.

Examples

iex> update_conversation(conversation, %{field: new_value})
{:ok, %Conversation{}}

iex> update_conversation(conversation, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function update_conversation_delivered_at(map)

Updates delivered_at column of user’s conversations.

Link to this function update_conversation_read_at(map)

Updates read_at column of user’s conversations.

Link to this function update_error(error, attrs)

Updates a error.

Examples

iex> update_error(error, %{field: new_value})
{:ok, %Error{}}

iex> update_error(error, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function update_message_report(message_report, attrs)

Updates a message_report.

Examples

iex> update_message_report(message_report, %{field: new_value})
{:ok, %MessageReport{}}

iex> update_message_report(message_report, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function update_referral(referral, attrs)

Updates a referral.

Examples

iex> update_referral(referral, %{field: new_value})
{:ok, %Referral{}}

iex> update_referral(error, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function update_user(user, attrs)

Updates a user.

Examples

iex> update_user(user, %{field: new_value})
{:ok, %User{}}

iex> update_user(user, %{field: bad_value})
{:error, %Ecto.Changeset{}}