View Source Boruta.Ecto.Admin.Clients (Boruta core v2.1.5)

Boruta.Ecto.Client resource administration

Link to this section Summary

Functions

Creates a client.

Deletes a Client.

Gets a single client.

Returns the list of clients.

Regenerates client secret. If a secret is provided as parameter updates it.

Updates a client.

Link to this section Functions

Creates a client.

examples

Examples

iex> create_client(%{field: value})
{:ok, %Client{}}

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

Deletes a Client.

examples

Examples

iex> delete_client(client)
{:ok, %Client{}}

iex> delete_client(client)
{:error, %Ecto.Changeset{}}

Gets a single client.

Raises Ecto.NoResultsError if the Client does not exist.

examples

Examples

iex> get_client!(123)
%Client{}

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

Returns the list of clients.

examples

Examples

iex> list_clients()
[%Client{}, ...]
Link to this function

regenerate_client_secret(client, secret \\ nil)

View Source

Regenerates client secret. If a secret is provided as parameter updates it.

examples

Examples

iex> regenerate_client_secret(client)
{:ok, %Client{}}
Link to this function

update_client(client, attrs)

View Source

Updates a client.

examples

Examples

iex> update_client(client, %{field: new_value})
{:ok, %Client{}}

iex> update_client(client, %{field: bad_value})
{:error, %Ecto.Changeset{}}