
commonMain.com.bselzer.gw2.v2.client.instance.MiniClient.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.client.extension.language
import com.bselzer.gw2.v2.client.model.Language
import com.bselzer.gw2.v2.model.mini.Mini
import com.bselzer.gw2.v2.model.mini.MiniId
import io.ktor.client.*
/**
* The mini-pet client.
* @see the wiki
*/
class MiniClient(httpClient: HttpClient, configuration: Gw2ClientConfiguration) : BaseClient(httpClient, configuration) {
private companion object {
const val MINIS = "minis"
}
/**
* @return the ids of the available minis
* @see the wiki
*/
suspend fun ids(): List = getIds(path = MINIS)
/**
* @return the minis associated with the [ids]
* @see the wiki
*/
suspend fun minis(ids: Collection, language: Language? = null): List = chunkedIds(ids, MINIS, instance = { Mini(id = it) }) {
language(language)
}
/**
* @return all the minis
* @see the wiki
*/
suspend fun minis(language: Language? = null): List = allIds(MINIS) {
language(language)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy