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

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{}}

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)

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)

Returns the list of bots.

Examples

iex> list_bots()
[%Bot{}, ...]

Updates a bot.

Examples

iex> update_bot(bot, %{field: new_value})
{:ok, %Bot{}}

iex> update_bot(bot, %{field: bad_value})
{:error, %Ecto.Changeset{}}