Custodian v0.0.1 Custodian.Bots View Source
The Bots context provides a boundary into the Custodian.Bots.Bot
schema. It
provides functions for listing, creating, updating, and deleting bots.
Link to this section Summary
Functions
Returns an %Ecto.Changeset{}
for tracking bot changes
Creates a bot
Deletes a Bot
Gets a single bot
Gets a single bot by some clause
Returns the list of bots
Updates a bot
Link to this section Functions
Link to this function
change_bot(bot)
View Source
change_bot(Custodian.Bots.Bot.t()) :: Ecto.Changeset.t()
Returns an %Ecto.Changeset{}
for tracking bot changes.
Examples
iex> change_bot(bot)
%Ecto.Changeset{source: %Bot{}}
Link to this function
create_bot(attrs \\ %{})
View Source
create_bot(map()) :: Custodian.Bots.Bot.t()
Creates a bot.
Examples
iex> create_bot(%{field: value})
{:ok, %Bot{}}
iex> create_bot(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function
delete_bot(bot)
View Source
delete_bot(Custodian.Bots.Bot.t()) :: Custodian.Bots.Bot.t()
Deletes a Bot.
Examples
iex> delete_bot(bot)
{:ok, %Bot{}}
iex> delete_bot(bot)
{:error, %Ecto.Changeset{}}
Gets a single bot.
Raises Ecto.NoResultsError
if the bot does not exist.
Examples
iex> get_bot!(123)
%Bot{}
iex> get_bot!(456)
** (Ecto.NoResultsError)
Link to this function
get_bot_by!(clauses)
View Source
get_bot_by!(Keyword.t()) :: Custodian.Bots.Bot.t()
Gets a single bot by some clause.
Raises Ecto.NoResultsError
if the bot does not exist.
Examples
iex> get_bot_by!(repo_id: 123)
%Bot{}
iex> get_bot_by!(repo_id: 456)
** (Ecto.NoResultsError)
Link to this function
update_bot(bot, attrs)
View Source
update_bot(Custodian.Bots.Bot.t(), map()) :: Custodian.Bots.Bot.t()
Updates a bot.
Examples
iex> update_bot(bot, %{field: new_value})
{:ok, %Bot{}}
iex> update_bot(bot, %{field: bad_value})
{:error, %Ecto.Changeset{}}