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

commonMain.com.algolia.client.api.ApiClient.kt Maven / Gradle / Ivy

Go to download

"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."

There is a newer version: 3.10.1
Show newest version
package com.algolia.client.api

import com.algolia.client.configuration.ClientOptions
import com.algolia.client.transport.Requester

/**
 * An interface representing an API client with specific properties and options.
 *
 * @property appId The unique identifier for the application using the API client.
 * @property apiKey The API key used for authentication.
 * @property options A set of custom client options to configure the behavior of the API client.
 */
public sealed interface ApiClient {
  public val appId: String
  public var apiKey: String
  public val options: ClientOptions
  public val requester: Requester

  /**
   * Helper method to switch the API key used to authenticate requests.
   */
  public fun setClientApiKey(apiKey: String) {
    this.apiKey = apiKey
    this.requester.setClientApiKey(apiKey)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy