tallgrass/pokemon/characteristic
Types
pub type Characteristic {
Characteristic(
id: Int,
gene_modulo: Int,
possible_values: List(Int),
highest_stat: Resource,
descriptions: List(Description),
)
}
Constructors
-
Characteristic( id: Int, gene_modulo: Int, possible_values: List(Int), highest_stat: Resource, descriptions: List(Description), )
Functions
pub fn fetch(client: Client) -> Result(PaginatedResource, Error)
Fetches a paginated list of pokemon characteristic resources.
Example
let result = characteristic.new() |> characteristic.fetch()
pub fn fetch_by_id(
client: Client,
id: Int,
) -> Result(Characteristic, Error)
Fetches a pokemon characteristic given the pokemon characteristic ID.
Example
let result = characteristic.new() |> characteristic.fetch_by_id(1)
pub fn fetch_resource(
client: Client,
resource: Resource,
) -> Result(Characteristic, Error)
Fetches a pokemon characteristic given a pokemon characteristic resource.
Example
let client = characteristic.new()
use res <- result.try(client |> characteristic.fetch())
let assert Ok(first) = res.results |> list.first
client |> characteristic.fetch_resource(first)