ExIsbndb.Author (ExIsbndb v1.0.1)

The ExIsbndb.Author module contains all the available endpoints for Authors.

All functions need to receive a map with params, but only those needed for the endpoint will be taken.

Link to this section Summary

Functions

Returns an Author and a list of its Books.

Returns all the Authors that match the given query.

Link to this section Functions

@spec get(map()) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}

Returns an Author and a list of its Books.

Params required:

  • name (string) - name of the Author

Params available:

  • page (integer) - page number of the Books to be retrieved
  • page_size(integer) - number of Books to be retrieved per page

Any other parameters will be ignored.

examples

Examples

iex> ExIsbndb.Author.get(%{name: "Stephen King", page: 1, page_size: 5})
{:ok, %Finch.Response{body: "...", headers: [...], status: 200}}
@spec search(map()) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}

Returns all the Authors that match the given query.

Params required:

  • query (string) - string used to search

Params available:

  • page (integer) - page number of the Authors to be searched
  • page_size (integer) - number of Authors to be searched per page

Any other parameters will be ignored.

examples

Examples

iex> ExIsbndb.Author.search(%{query: "sanderson", page: 1, page_size: 5})
{:ok, %Finch.Response{body: "...", headers: [...], status: 200}}