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