commonMain.app.moviebase.tmdb.api.TmdbFindApi.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.TmdbExternalSource
import app.moviebase.tmdb.model.TmdbFindResults
import app.moviebase.tmdb.core.endPointV3
import app.moviebase.tmdb.core.parameterLanguage
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.request.get
import io.ktor.client.request.parameter
class TmdbFindApi internal constructor(private val client: HttpClient) {
suspend fun find(externalId: String, language: String, externalSource: TmdbExternalSource): TmdbFindResults = client.get {
endPointV3("find", externalId)
parameterLanguage(language)
parameter("external_source", externalSource.value)
}.body()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy