tallgrass/encounter/condition/value

Types

pub type EncounterConditionValue {
  EncounterConditionValue(
    id: Int,
    name: String,
    condition: Resource,
    names: List(Name),
  )
}

Constructors

  • EncounterConditionValue(
      id: Int,
      name: String,
      condition: Resource,
      names: List(Name),
    )

Functions

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

Fetches a paginated list of encounter condition value resources.

Example

let result = value |> method.fetch()
pub fn fetch_by_id(
  client: Client,
  id: Int,
) -> Result(EncounterConditionValue, Error)

Fetches an encounter condition value given the encounter condition value ID.

Example

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

Fetches an encounter condition value given the encounter condition value name.

Example

let result = value.new() |> value.fetch_by_name("swarm-yes")
pub fn fetch_resource(
  client: Client,
  resource: Resource,
) -> Result(EncounterConditionValue, Error)

Fetches an encounter condition value given an encounter condition value resource.

Example

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