Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): updates #93

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 89
configured_endpoints: 102
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ interface LithicClient {

fun threeDS(): ThreeDSService

fun reports(): ReportService

fun cardProduct(): CardProductService

/** API status check */
fun apiStatus(
params: ClientApiStatusParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ interface LithicClientAsync {

fun threeDS(): ThreeDSServiceAsync

fun reports(): ReportServiceAsync

fun cardProduct(): CardProductServiceAsync

/** API status check */
suspend fun apiStatus(
params: ClientApiStatusParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ constructor(

private val threeDS: ThreeDSServiceAsync by lazy { ThreeDSServiceAsyncImpl(clientOptions) }

private val reports: ReportServiceAsync by lazy { ReportServiceAsyncImpl(clientOptions) }

private val cardProduct: CardProductServiceAsync by lazy {
CardProductServiceAsyncImpl(clientOptions)
}

override fun sync(): LithicClient = sync

override fun accounts(): AccountServiceAsync = accounts
Expand Down Expand Up @@ -120,6 +126,10 @@ constructor(

override fun threeDS(): ThreeDSServiceAsync = threeDS

override fun reports(): ReportServiceAsync = reports

override fun cardProduct(): CardProductServiceAsync = cardProduct

private val apiStatusHandler: Handler<ApiStatus> =
jsonHandler<ApiStatus>(clientOptions.jsonMapper).withErrorHandler(errorHandler)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ constructor(

private val threeDS: ThreeDSService by lazy { ThreeDSServiceImpl(clientOptions) }

private val reports: ReportService by lazy { ReportServiceImpl(clientOptions) }

private val cardProduct: CardProductService by lazy { CardProductServiceImpl(clientOptions) }

override fun async(): LithicClientAsync = async

override fun accounts(): AccountService = accounts
Expand Down Expand Up @@ -117,6 +121,10 @@ constructor(

override fun threeDS(): ThreeDSService = threeDS

override fun reports(): ReportService = reports

override fun cardProduct(): CardProductService = cardProduct

private val apiStatusHandler: Handler<ApiStatus> =
jsonHandler<ApiStatus>(clientOptions.jsonMapper).withErrorHandler(errorHandler)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// File generated from our OpenAPI spec by Stainless.

package com.lithic.api.models

import com.lithic.api.core.NoAutoDetect
import com.lithic.api.core.toUnmodifiable
import com.lithic.api.models.*
import java.util.Objects

class AccountCreditConfigurationRetrieveParams
constructor(
private val accountToken: String,
private val additionalQueryParams: Map<String, List<String>>,
private val additionalHeaders: Map<String, List<String>>,
) {

fun accountToken(): String = accountToken

internal fun getQueryParams(): Map<String, List<String>> = additionalQueryParams

internal fun getHeaders(): Map<String, List<String>> = additionalHeaders

fun getPathParam(index: Int): String {
return when (index) {
0 -> accountToken
else -> ""
}
}

fun _additionalQueryParams(): Map<String, List<String>> = additionalQueryParams

fun _additionalHeaders(): Map<String, List<String>> = additionalHeaders

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is AccountCreditConfigurationRetrieveParams &&
this.accountToken == other.accountToken &&
this.additionalQueryParams == other.additionalQueryParams &&
this.additionalHeaders == other.additionalHeaders
}

override fun hashCode(): Int {
return Objects.hash(
accountToken,
additionalQueryParams,
additionalHeaders,
)
}

override fun toString() =
"AccountCreditConfigurationRetrieveParams{accountToken=$accountToken, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders}"

fun toBuilder() = Builder().from(this)

companion object {

fun builder() = Builder()
}

@NoAutoDetect
class Builder {

private var accountToken: String? = null
private var additionalQueryParams: MutableMap<String, MutableList<String>> = mutableMapOf()
private var additionalHeaders: MutableMap<String, MutableList<String>> = mutableMapOf()

internal fun from(
accountCreditConfigurationRetrieveParams: AccountCreditConfigurationRetrieveParams
) = apply {
this.accountToken = accountCreditConfigurationRetrieveParams.accountToken
additionalQueryParams(accountCreditConfigurationRetrieveParams.additionalQueryParams)
additionalHeaders(accountCreditConfigurationRetrieveParams.additionalHeaders)
}

fun accountToken(accountToken: String) = apply { this.accountToken = accountToken }

fun additionalQueryParams(additionalQueryParams: Map<String, List<String>>) = apply {
this.additionalQueryParams.clear()
putAllQueryParams(additionalQueryParams)
}

fun putQueryParam(name: String, value: String) = apply {
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value)
}

fun putQueryParams(name: String, values: Iterable<String>) = apply {
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values)
}

fun putAllQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply {
additionalQueryParams.forEach(this::putQueryParams)
}

fun removeQueryParam(name: String) = apply {
this.additionalQueryParams.put(name, mutableListOf())
}

fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
this.additionalHeaders.clear()
putAllHeaders(additionalHeaders)
}

fun putHeader(name: String, value: String) = apply {
this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value)
}

fun putHeaders(name: String, values: Iterable<String>) = apply {
this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values)
}

fun putAllHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
additionalHeaders.forEach(this::putHeaders)
}

fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) }

fun build(): AccountCreditConfigurationRetrieveParams =
AccountCreditConfigurationRetrieveParams(
checkNotNull(accountToken) { "`accountToken` is required but was not set" },
additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
)
}
}
Loading