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

com.personio.synthetics.client.SyntheticsApiClient.kt Maven / Gradle / Ivy

There is a newer version: 2.7.0
Show newest version
package com.personio.synthetics.client

import com.datadog.api.client.ApiClient
import com.datadog.api.client.v1.api.SyntheticsApi
import com.personio.synthetics.config.Config

/**
 * API Client for the Datadog Synthetic test
 */
class SyntheticsApiClient(credentialsProvider: CredentialsProvider, apiHost: String = Config.testConfig.datadogApiHost) : SyntheticsApi() {
    init {
        val credentials = credentialsProvider.getCredentials()
        apiClient =
            ApiClient.getDefaultApiClient().apply {
                serverVariables = mapOf("site" to apiHost)
                configureApiKeys(mapOf("apiKeyAuth" to credentials.apiKey, "appKeyAuth" to credentials.appKey))
            }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy