vista_client v0.1.1 VistaClient

Documentation for VistaClient.

Examples

iex> {:ok, cinemas} = VistaClient.get_cinemas()
iex> cinemas |> Enum.find(fn cinema -> cinema.id == 1001 end)
%VistaClient.Cinema{id: 1001, name: "Delphi Lux"}

Link to this section Summary

Link to this section Types

Link to this type

headers()

headers() :: [{charlist(), charlist()}]
Link to this type

reason()

reason() :: any()
Link to this type

retrieved_entity()

retrieved_entity() :: :cinemas | :scheduled_films | :sessions
Link to this type

url()

url() :: charlist()

Link to this section Functions

Link to this function

get(what, opts \\ [])

Callback implementation for VistaClient.Behaviour.get_cinemas/0.

Link to this function

get_endpoints()

Link to this function

get_scheduled_films()

Callback implementation for VistaClient.Behaviour.get_scheduled_films/0.

Link to this function

get_session_availabilty(session_id)

Callback implementation for VistaClient.Behaviour.get_session_availabilty/1.

Callback implementation for VistaClient.Behaviour.get_sessions/0.

Link to this function

make_basic_headers()

make_basic_headers() :: {:ok, headers()} | {:error, reason()}

creates auth and content-type and accept headers

Link to this function

make_request(url)

Link to this function

make_structs(endpoints, atom)

Link to this function

make_url_for(atom, api_url)

Link to this function

make_url_for(what, api_url, list)

Link to this function

online?()

online?() :: {:ok, boolean()} | {:error, reason()}

Returns

  • {:ok, true} if VISTA server seems up
  • {:ok, false} if not
  • {:error, reason} on config error

EXAMPLES

iex> VistaClient.online?()
{:ok, true}
Link to this function

url_for(what, opts \\ [])

url_for(retrieved_entity(), keyword()) :: {:ok, url()} | {:error, reason()}