commonMain.com.bselzer.gw2.v2.client.instance.RaceClient.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of v2-client Show documentation
Show all versions of v2-client Show documentation
Ktor client for v2 endpoints of the Guild Wars 2 API.
The newest version!
package com.bselzer.gw2.v2.client.instance
import com.bselzer.gw2.v2.model.race.Race
import com.bselzer.gw2.v2.model.race.RaceId
import io.ktor.client.*
/**
* The race client.
* @see the wikithe wiki
*/
suspend fun ids(): List = getIds(path = RACES)
/**
* @return the race associated with the [id]
* @see the wiki
*/
suspend fun race(id: RaceId): Race = getSingleById(id, RACES, instance = { Race(id = it) })
/**
* @return the races associated with the [ids]
* @see the wiki
*/
suspend fun races(ids: Collection): List = chunkedIds(ids, RACES, instance = { Race(id = it) })
/**
* @return all the races
* @see the wiki
*/
suspend fun races(): List = allIds(RACES)
}