Skip to content

Commit cc5f1bc

Browse files
committed
feat(api): updates (#102)
1 parent 89a860f commit cc5f1bc

145 files changed

Lines changed: 13331 additions & 530 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 89
1+
configured_endpoints: 102

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ interface LithicClient {
5050

5151
fun threeDS(): ThreeDSService
5252

53+
fun reports(): ReportService
54+
55+
fun cardProduct(): CardProductService
56+
5357
/** API status check */
5458
@JvmOverloads
5559
fun apiStatus(

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ interface LithicClientAsync {
5151

5252
fun threeDS(): ThreeDSServiceAsync
5353

54+
fun reports(): ReportServiceAsync
55+
56+
fun cardProduct(): CardProductServiceAsync
57+
5458
/** API status check */
5559
@JvmOverloads
5660
fun apiStatus(

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ constructor(
8080

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

83+
private val reports: ReportServiceAsync by lazy { ReportServiceAsyncImpl(clientOptions) }
84+
85+
private val cardProduct: CardProductServiceAsync by lazy {
86+
CardProductServiceAsyncImpl(clientOptions)
87+
}
88+
8389
override fun sync(): LithicClient = sync
8490

8591
override fun accounts(): AccountServiceAsync = accounts
@@ -121,6 +127,10 @@ constructor(
121127

122128
override fun threeDS(): ThreeDSServiceAsync = threeDS
123129

130+
override fun reports(): ReportServiceAsync = reports
131+
132+
override fun cardProduct(): CardProductServiceAsync = cardProduct
133+
124134
private val apiStatusHandler: Handler<ApiStatus> =
125135
jsonHandler<ApiStatus>(clientOptions.jsonMapper).withErrorHandler(errorHandler)
126136

lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ constructor(
7777

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

80+
private val reports: ReportService by lazy { ReportServiceImpl(clientOptions) }
81+
82+
private val cardProduct: CardProductService by lazy { CardProductServiceImpl(clientOptions) }
83+
8084
override fun async(): LithicClientAsync = async
8185

8286
override fun accounts(): AccountService = accounts
@@ -117,6 +121,10 @@ constructor(
117121

118122
override fun threeDS(): ThreeDSService = threeDS
119123

124+
override fun reports(): ReportService = reports
125+
126+
override fun cardProduct(): CardProductService = cardProduct
127+
120128
private val apiStatusHandler: Handler<ApiStatus> =
121129
jsonHandler<ApiStatus>(clientOptions.jsonMapper).withErrorHandler(errorHandler)
122130

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package com.lithic.api.models
4+
5+
import com.lithic.api.core.NoAutoDetect
6+
import com.lithic.api.core.toUnmodifiable
7+
import com.lithic.api.models.*
8+
import java.util.Objects
9+
10+
class AccountCreditConfigurationRetrieveParams
11+
constructor(
12+
private val accountToken: String,
13+
private val additionalQueryParams: Map<String, List<String>>,
14+
private val additionalHeaders: Map<String, List<String>>,
15+
) {
16+
17+
fun accountToken(): String = accountToken
18+
19+
@JvmSynthetic internal fun getQueryParams(): Map<String, List<String>> = additionalQueryParams
20+
21+
@JvmSynthetic internal fun getHeaders(): Map<String, List<String>> = additionalHeaders
22+
23+
fun getPathParam(index: Int): String {
24+
return when (index) {
25+
0 -> accountToken
26+
else -> ""
27+
}
28+
}
29+
30+
fun _additionalQueryParams(): Map<String, List<String>> = additionalQueryParams
31+
32+
fun _additionalHeaders(): Map<String, List<String>> = additionalHeaders
33+
34+
override fun equals(other: Any?): Boolean {
35+
if (this === other) {
36+
return true
37+
}
38+
39+
return other is AccountCreditConfigurationRetrieveParams &&
40+
this.accountToken == other.accountToken &&
41+
this.additionalQueryParams == other.additionalQueryParams &&
42+
this.additionalHeaders == other.additionalHeaders
43+
}
44+
45+
override fun hashCode(): Int {
46+
return Objects.hash(
47+
accountToken,
48+
additionalQueryParams,
49+
additionalHeaders,
50+
)
51+
}
52+
53+
override fun toString() =
54+
"AccountCreditConfigurationRetrieveParams{accountToken=$accountToken, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders}"
55+
56+
fun toBuilder() = Builder().from(this)
57+
58+
companion object {
59+
60+
@JvmStatic fun builder() = Builder()
61+
}
62+
63+
@NoAutoDetect
64+
class Builder {
65+
66+
private var accountToken: String? = null
67+
private var additionalQueryParams: MutableMap<String, MutableList<String>> = mutableMapOf()
68+
private var additionalHeaders: MutableMap<String, MutableList<String>> = mutableMapOf()
69+
70+
@JvmSynthetic
71+
internal fun from(
72+
accountCreditConfigurationRetrieveParams: AccountCreditConfigurationRetrieveParams
73+
) = apply {
74+
this.accountToken = accountCreditConfigurationRetrieveParams.accountToken
75+
additionalQueryParams(accountCreditConfigurationRetrieveParams.additionalQueryParams)
76+
additionalHeaders(accountCreditConfigurationRetrieveParams.additionalHeaders)
77+
}
78+
79+
fun accountToken(accountToken: String) = apply { this.accountToken = accountToken }
80+
81+
fun additionalQueryParams(additionalQueryParams: Map<String, List<String>>) = apply {
82+
this.additionalQueryParams.clear()
83+
putAllQueryParams(additionalQueryParams)
84+
}
85+
86+
fun putQueryParam(name: String, value: String) = apply {
87+
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value)
88+
}
89+
90+
fun putQueryParams(name: String, values: Iterable<String>) = apply {
91+
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values)
92+
}
93+
94+
fun putAllQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply {
95+
additionalQueryParams.forEach(this::putQueryParams)
96+
}
97+
98+
fun removeQueryParam(name: String) = apply {
99+
this.additionalQueryParams.put(name, mutableListOf())
100+
}
101+
102+
fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
103+
this.additionalHeaders.clear()
104+
putAllHeaders(additionalHeaders)
105+
}
106+
107+
fun putHeader(name: String, value: String) = apply {
108+
this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value)
109+
}
110+
111+
fun putHeaders(name: String, values: Iterable<String>) = apply {
112+
this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values)
113+
}
114+
115+
fun putAllHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
116+
additionalHeaders.forEach(this::putHeaders)
117+
}
118+
119+
fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) }
120+
121+
fun build(): AccountCreditConfigurationRetrieveParams =
122+
AccountCreditConfigurationRetrieveParams(
123+
checkNotNull(accountToken) { "`accountToken` is required but was not set" },
124+
additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
125+
additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
126+
)
127+
}
128+
}

0 commit comments

Comments
 (0)