All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.bselzer.gw2.v2.client.instance.RaceClient.kt Maven / Gradle / Ivy

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)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy