commonMain.com.algolia.search.client.internal.ClientAnalyticsImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of algoliasearch-client-kotlin-jvm Show documentation
Show all versions of algoliasearch-client-kotlin-jvm Show documentation
"Algolia is a powerful search-as-a-service solution, made easy to use with API clients, UI libraries, and pre-built integrations. Algolia API Client for Kotlin lets you easily use the Algolia Search REST API from your JVM project, such as Android or backend implementations."
package com.algolia.search.client.internal
import com.algolia.search.client.ClientAnalytics
import com.algolia.search.configuration.Configuration
import com.algolia.search.configuration.Credentials
import com.algolia.search.endpoint.EndpointAnalytics
import com.algolia.search.endpoint.internal.EndpointAnalytics
import com.algolia.search.model.response.ResponseABTests
import com.algolia.search.transport.CustomRequester
import com.algolia.search.transport.RequestOptions
import com.algolia.search.transport.internal.Transport
internal class ClientAnalyticsImpl internal constructor(
internal val transport: Transport,
) : ClientAnalytics,
EndpointAnalytics by EndpointAnalytics(transport),
Configuration by transport,
Credentials by transport.credentials,
CustomRequester by transport {
override suspend fun browseAllABTests(
hitsPerPage: Int?,
requestOptions: RequestOptions?,
): List {
val responses = mutableListOf()
var page = 0
while (true) {
val response = listABTests(page, hitsPerPage, requestOptions)
if (response.count == response.total || response.count == 0) break
page += response.count
responses += response
}
return responses
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy