commonMain.app.moviebase.tmdb.api.TmdbConfigurationApi.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tmdb-api Show documentation
Show all versions of tmdb-api Show documentation
A Kotlin Multiplatform library to access the TMDB API.
The newest version!
package app.moviebase.tmdb.api
import app.moviebase.tmdb.model.TmdbConfiguration
import app.moviebase.tmdb.core.endPointV3
import app.moviebase.tmdb.model.TmdbConfigurationCountry
import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.request.*
class TmdbConfigurationApi internal constructor(private val client: HttpClient) {
/**
* Get the system wide configuration information.
* @see [Documentation] (https://developers.themoviedb.org/3/configuration/get-api-configuration)
*/
suspend fun getApiConfiguration(): TmdbConfiguration = client.get {
endPointV3("configuration")
}.body()
/**
* Get the list of countries (ISO 3166-1 tags) used throughout TMDB.
* [Documentation](https://developer.themoviedb.org/reference/configuration-countries)
*/
suspend fun getCountries(): List = client.get {
endPointV3("configuration", "countries")
}.body()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy