tallgrass/location/pal_park_area

Types

pub type PalParkArea {
  PalParkArea(id: Int, name: String, names: List(Name))
}

Constructors

  • PalParkArea(id: Int, name: String, names: List(Name))

Functions

pub fn fetch(client: Client) -> Result(PaginatedResource, Error)

Fetches a paginated list of pal park area resources.

Example

let result = pal_park_area.new() |> pal_park_area.fetch()
pub fn fetch_by_id(
  client: Client,
  id: Int,
) -> Result(PalParkArea, Error)

Fetches a pal park area given the pal park area ID.

Example

let result = pal_park_area.new() |> pal_park_area.fetch_by_id(1)
pub fn fetch_by_name(
  client: Client,
  name: String,
) -> Result(PalParkArea, Error)

Fetches a pal park area given the pal park area name.

Example

let result = pal_park_area.new() |> pal_park_area.fetch_by_name("forest")
pub fn fetch_resource(
  client: Client,
  resource: Resource,
) -> Result(PalParkArea, Error)

Fetches a pal park area given a pal park area resource.

Example

let client = pal_park_area.new()
use res <- result.try(client |> pal_park_area.fetch())
let assert Ok(first) = res.results |> list.first
client |> pal_park_area.fetch_resource(first)
pub fn new() -> Client

Creates a new Client. This is a re-export of client.new, for the sake of convenience.

Search Document