tallgrass/move/battle_style
Types
pub type MoveBattleStyle {
MoveBattleStyle(id: Int, name: String, names: List(Name))
}
Constructors
-
MoveBattleStyle(id: Int, name: String, names: List(Name))
Functions
pub fn fetch(client: Client) -> Result(PaginatedResource, Error)
Fetches a paginated list of move battle style resources.
Example
let result = battle_style.new() |> battle_style.fetch()
pub fn fetch_by_id(
client: Client,
id: Int,
) -> Result(MoveBattleStyle, Error)
Fetches a move battle style given the move battle style ID.
Example
let result = battle_style.new() |> battle_style.fetch_by_id(1)
pub fn fetch_by_name(
client: Client,
name: String,
) -> Result(MoveBattleStyle, Error)
Fetches a move battle style given the move battle style name.
Example
let result = battle_style.new() |> battle_style.fetch_by_name("attack")
pub fn fetch_resource(
client: Client,
resource: Resource,
) -> Result(MoveBattleStyle, Error)
Fetches a move battle style given a move battle style resource.
Example
let client = battle_style.new()
use res <- result.try(client |> battle_style.fetch())
let assert Ok(first) = res.results |> list.first
client |> battle_style.fetch_resource(first)