tallgrass/pokemon/pokeathlon_stat

Types

pub type NaturePokeathlonStatAffect {
  NaturePokeathlonStatAffect(max_change: Int, nature: Resource)
}

Constructors

  • NaturePokeathlonStatAffect(max_change: Int, nature: Resource)
pub type NaturePokeathlonStatAffectSets {
  NaturePokeathlonStatAffectSets(
    increase: List(NaturePokeathlonStatAffect),
    decrease: List(NaturePokeathlonStatAffect),
  )
}

Constructors

  • NaturePokeathlonStatAffectSets(
      increase: List(NaturePokeathlonStatAffect),
      decrease: List(NaturePokeathlonStatAffect),
    )
pub type PokeathlonStat {
  PokeathlonStat(
    id: Int,
    name: String,
    names: List(Name),
    affecting_natures: NaturePokeathlonStatAffectSets,
  )
}

Constructors

  • PokeathlonStat(
      id: Int,
      name: String,
      names: List(Name),
      affecting_natures: NaturePokeathlonStatAffectSets,
    )

Functions

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

Fetches a paginated list of pokeathlon stat resources.

Example

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

Fetches a pokeathlon stat given the pokeathlon stat ID.

Example

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

Fetches a pokeathlon stat given the pokeathlon stat name.

Example

let result = pokeathlon_stat.new() |> pokeathlon_stat.fetch_by_name("skill")
pub fn fetch_resource(
  client: Client,
  resource: Resource,
) -> Result(PokeathlonStat, Error)

Fetches a pokeathlon stat given a pokeathlon stat resource.

Example

let client = pokeathlon_stat.new()
use res <- result.try(client |> pokeathlon_stat.fetch())
let assert Ok(first) = res.results |> list.first
client |> pokeathlon_stat.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