Ghibli.Vehicles (ghibli_api v0.1.0)

Fetches Vehicles from API. The response from the API looks like this:

{
  "id": "923d70c9-8f15-4972-ad53-0128b261d628",
  "name": "Sosuke's Boat",
  "description": "A toy boat where Sosuke plays",
  "vehicle_class": "Boat",
  "length": "10",
  "pilot": "https://ghibliapi.vercel.app/people/a10f64f3-e0b6-4a94-bf30-87ad8bc51607",
  "films": [
    "https://ghibliapi.vercel.app/films/758bf02e-3122-46e0-884e-67cf83df1786"
  ],
  "url": "https://ghibliapi.vercel.app/films/758bf02e-3122-46e0-884e-67cf83df1786"
}

Summary

Types

t()

@type t() :: %Ghibli.Vehicles{
  description: String.t(),
  films: [String.t()],
  id: String.t(),
  length: String.t(),
  name: String.t(),
  pilot: String.t(),
  url: String.t(),
  vehicle_class: String.t()
}

Functions

all()

@spec all() :: {:ok, [t()]} | {:error, String.t()}

get_by(id)

@spec get_by(id :: String.t()) :: {:ok, t()} | {:error, String.t()}