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