tallgrass/pokemon/egg_group
Types
Functions
pub fn fetch(client: Client) -> Result(PaginatedResource, Error)
Fetches a paginated list of egg group resources.
Example
let result = egg_group.new() |> egg_group.fetch()
pub fn fetch_by_id(
client: Client,
id: Int,
) -> Result(EggGroup, Error)
Fetches a egg group given the egg group ID.
Example
let result = egg_group.new() |> egg_group.fetch_by_id(1)
pub fn fetch_by_name(
client: Client,
name: String,
) -> Result(EggGroup, Error)
Fetches a egg group given the egg group name.
Example
let result = egg_group.new() |> egg_group.fetch_by_name("monster")
pub fn fetch_resource(
client: Client,
resource: Resource,
) -> Result(EggGroup, Error)
Fetches a egg group given a egg group resource.
Example
let client = egg_group.new()
use res <- result.try(client |> egg_group.fetch())
let assert Ok(first) = res.results |> list.first
client |> egg_group.fetch_resource(first)