com.lithic.api.core.RequestOptions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lithic-kotlin-core Show documentation
Show all versions of lithic-kotlin-core Show documentation
The Lithic Developer API is designed to provide a predictable programmatic
interface for accessing your Lithic account through an API and transaction
webhooks. Note that your API key is a secret and should be treated as such.
Don't share it with anyone, including us. We will never ask you for it.
The newest version!
package com.lithic.api.core
import java.time.Duration
class RequestOptions
private constructor(
val responseValidation: Boolean?,
val timeout: Duration?,
) {
fun applyDefaults(options: RequestOptions): RequestOptions {
return RequestOptions(
responseValidation = this.responseValidation ?: options.responseValidation,
timeout = this.timeout ?: options.timeout
)
}
companion object {
private val NONE = builder().build()
fun none() = NONE
fun builder() = Builder()
}
class Builder {
private var responseValidation: Boolean? = null
private var timeout: Duration? = null
fun responseValidation(responseValidation: Boolean) = apply {
this.responseValidation = responseValidation
}
fun timeout(timeout: Duration) = apply { this.timeout = timeout }
fun build(): RequestOptions {
return RequestOptions(responseValidation, timeout)
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy