Skip to content

Commit 815c889

Browse files
committed
feat(api): rename token and type to financial_account_token and financial_account_type (#131)
1 parent 465e513 commit 815c889

12 files changed

Lines changed: 320 additions & 52 deletions

File tree

.stats.yml

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

lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ private constructor(
2828
private val lastTransactionEventToken: JsonField<String>,
2929
private val lastTransactionToken: JsonField<String>,
3030
private val pendingAmount: JsonField<Long>,
31-
private val token: JsonField<String>,
31+
private val financialAccountToken: JsonField<String>,
3232
private val totalAmount: JsonField<Long>,
33-
private val type: JsonField<Type>,
33+
private val financialAccountType: JsonField<FinancialAccountType>,
3434
private val updated: JsonField<OffsetDateTime>,
3535
private val additionalProperties: Map<String, JsonValue>,
3636
) {
@@ -65,7 +65,8 @@ private constructor(
6565
fun pendingAmount(): Long = pendingAmount.getRequired("pending_amount")
6666

6767
/** Globally unique identifier for the financial account that holds this balance. */
68-
fun token(): String = token.getRequired("token")
68+
fun financialAccountToken(): String =
69+
financialAccountToken.getRequired("financial_account_token")
6970

7071
/**
7172
* The sum of available and pending balance in the currency's smallest unit (e.g., cents for
@@ -74,7 +75,8 @@ private constructor(
7475
fun totalAmount(): Long = totalAmount.getRequired("total_amount")
7576

7677
/** Type of financial account. */
77-
fun type(): Type = type.getRequired("type")
78+
fun financialAccountType(): FinancialAccountType =
79+
financialAccountType.getRequired("financial_account_type")
7880

7981
/** Date and time for when the balance was last updated. */
8082
fun updated(): OffsetDateTime = updated.getRequired("updated")
@@ -108,7 +110,9 @@ private constructor(
108110
@JsonProperty("pending_amount") @ExcludeMissing fun _pendingAmount() = pendingAmount
109111

110112
/** Globally unique identifier for the financial account that holds this balance. */
111-
@JsonProperty("token") @ExcludeMissing fun _token() = token
113+
@JsonProperty("financial_account_token")
114+
@ExcludeMissing
115+
fun _financialAccountToken() = financialAccountToken
112116

113117
/**
114118
* The sum of available and pending balance in the currency's smallest unit (e.g., cents for
@@ -117,7 +121,9 @@ private constructor(
117121
@JsonProperty("total_amount") @ExcludeMissing fun _totalAmount() = totalAmount
118122

119123
/** Type of financial account. */
120-
@JsonProperty("type") @ExcludeMissing fun _type() = type
124+
@JsonProperty("financial_account_type")
125+
@ExcludeMissing
126+
fun _financialAccountType() = financialAccountType
121127

122128
/** Date and time for when the balance was last updated. */
123129
@JsonProperty("updated") @ExcludeMissing fun _updated() = updated
@@ -134,9 +140,9 @@ private constructor(
134140
lastTransactionEventToken()
135141
lastTransactionToken()
136142
pendingAmount()
137-
token()
143+
financialAccountToken()
138144
totalAmount()
139-
type()
145+
financialAccountType()
140146
updated()
141147
validated = true
142148
}
@@ -156,9 +162,9 @@ private constructor(
156162
this.lastTransactionEventToken == other.lastTransactionEventToken &&
157163
this.lastTransactionToken == other.lastTransactionToken &&
158164
this.pendingAmount == other.pendingAmount &&
159-
this.token == other.token &&
165+
this.financialAccountToken == other.financialAccountToken &&
160166
this.totalAmount == other.totalAmount &&
161-
this.type == other.type &&
167+
this.financialAccountType == other.financialAccountType &&
162168
this.updated == other.updated &&
163169
this.additionalProperties == other.additionalProperties
164170
}
@@ -173,9 +179,9 @@ private constructor(
173179
lastTransactionEventToken,
174180
lastTransactionToken,
175181
pendingAmount,
176-
token,
182+
financialAccountToken,
177183
totalAmount,
178-
type,
184+
financialAccountType,
179185
updated,
180186
additionalProperties,
181187
)
@@ -184,7 +190,7 @@ private constructor(
184190
}
185191

186192
override fun toString() =
187-
"Balance{availableAmount=$availableAmount, created=$created, currency=$currency, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, token=$token, totalAmount=$totalAmount, type=$type, updated=$updated, additionalProperties=$additionalProperties}"
193+
"Balance{availableAmount=$availableAmount, created=$created, currency=$currency, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, financialAccountToken=$financialAccountToken, totalAmount=$totalAmount, financialAccountType=$financialAccountType, updated=$updated, additionalProperties=$additionalProperties}"
188194

189195
companion object {
190196

@@ -199,9 +205,9 @@ private constructor(
199205
private var lastTransactionEventToken: JsonField<String> = JsonMissing.of()
200206
private var lastTransactionToken: JsonField<String> = JsonMissing.of()
201207
private var pendingAmount: JsonField<Long> = JsonMissing.of()
202-
private var token: JsonField<String> = JsonMissing.of()
208+
private var financialAccountToken: JsonField<String> = JsonMissing.of()
203209
private var totalAmount: JsonField<Long> = JsonMissing.of()
204-
private var type: JsonField<Type> = JsonMissing.of()
210+
private var financialAccountType: JsonField<FinancialAccountType> = JsonMissing.of()
205211
private var updated: JsonField<OffsetDateTime> = JsonMissing.of()
206212
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
207213

@@ -213,9 +219,9 @@ private constructor(
213219
this.lastTransactionEventToken = balance.lastTransactionEventToken
214220
this.lastTransactionToken = balance.lastTransactionToken
215221
this.pendingAmount = balance.pendingAmount
216-
this.token = balance.token
222+
this.financialAccountToken = balance.financialAccountToken
217223
this.totalAmount = balance.totalAmount
218-
this.type = balance.type
224+
this.financialAccountType = balance.financialAccountType
219225
this.updated = balance.updated
220226
additionalProperties(balance.additionalProperties)
221227
}
@@ -295,12 +301,15 @@ private constructor(
295301
}
296302

297303
/** Globally unique identifier for the financial account that holds this balance. */
298-
fun token(token: String) = token(JsonField.of(token))
304+
fun financialAccountToken(financialAccountToken: String) =
305+
financialAccountToken(JsonField.of(financialAccountToken))
299306

300307
/** Globally unique identifier for the financial account that holds this balance. */
301-
@JsonProperty("token")
308+
@JsonProperty("financial_account_token")
302309
@ExcludeMissing
303-
fun token(token: JsonField<String>) = apply { this.token = token }
310+
fun financialAccountToken(financialAccountToken: JsonField<String>) = apply {
311+
this.financialAccountToken = financialAccountToken
312+
}
304313

305314
/**
306315
* The sum of available and pending balance in the currency's smallest unit (e.g., cents for
@@ -317,12 +326,15 @@ private constructor(
317326
fun totalAmount(totalAmount: JsonField<Long>) = apply { this.totalAmount = totalAmount }
318327

319328
/** Type of financial account. */
320-
fun type(type: Type) = type(JsonField.of(type))
329+
fun financialAccountType(financialAccountType: FinancialAccountType) =
330+
financialAccountType(JsonField.of(financialAccountType))
321331

322332
/** Type of financial account. */
323-
@JsonProperty("type")
333+
@JsonProperty("financial_account_type")
324334
@ExcludeMissing
325-
fun type(type: JsonField<Type>) = apply { this.type = type }
335+
fun financialAccountType(financialAccountType: JsonField<FinancialAccountType>) = apply {
336+
this.financialAccountType = financialAccountType
337+
}
326338

327339
/** Date and time for when the balance was last updated. */
328340
fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated))
@@ -354,15 +366,15 @@ private constructor(
354366
lastTransactionEventToken,
355367
lastTransactionToken,
356368
pendingAmount,
357-
token,
369+
financialAccountToken,
358370
totalAmount,
359-
type,
371+
financialAccountType,
360372
updated,
361373
additionalProperties.toUnmodifiable(),
362374
)
363375
}
364376

365-
class Type
377+
class FinancialAccountType
366378
@JsonCreator
367379
private constructor(
368380
private val value: JsonField<String>,
@@ -375,7 +387,7 @@ private constructor(
375387
return true
376388
}
377389

378-
return other is Type && this.value == other.value
390+
return other is FinancialAccountType && this.value == other.value
379391
}
380392

381393
override fun hashCode() = value.hashCode()
@@ -384,11 +396,11 @@ private constructor(
384396

385397
companion object {
386398

387-
@JvmField val ISSUING = Type(JsonField.of("ISSUING"))
399+
@JvmField val ISSUING = FinancialAccountType(JsonField.of("ISSUING"))
388400

389-
@JvmField val RESERVE = Type(JsonField.of("RESERVE"))
401+
@JvmField val RESERVE = FinancialAccountType(JsonField.of("RESERVE"))
390402

391-
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
403+
@JvmStatic fun of(value: String) = FinancialAccountType(JsonField.of(value))
392404
}
393405

394406
enum class Known {
@@ -413,7 +425,7 @@ private constructor(
413425
when (this) {
414426
ISSUING -> Known.ISSUING
415427
RESERVE -> Known.RESERVE
416-
else -> throw LithicInvalidDataException("Unknown Type: $value")
428+
else -> throw LithicInvalidDataException("Unknown FinancialAccountType: $value")
417429
}
418430

419431
fun asString(): String = _value().asStringOrThrow()
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
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 DigitalCardArtRetrieveParams
11+
constructor(
12+
private val digitalCardArtToken: String,
13+
private val additionalQueryParams: Map<String, List<String>>,
14+
private val additionalHeaders: Map<String, List<String>>,
15+
) {
16+
17+
fun digitalCardArtToken(): String = digitalCardArtToken
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 -> digitalCardArtToken
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 DigitalCardArtRetrieveParams &&
40+
this.digitalCardArtToken == other.digitalCardArtToken &&
41+
this.additionalQueryParams == other.additionalQueryParams &&
42+
this.additionalHeaders == other.additionalHeaders
43+
}
44+
45+
override fun hashCode(): Int {
46+
return Objects.hash(
47+
digitalCardArtToken,
48+
additionalQueryParams,
49+
additionalHeaders,
50+
)
51+
}
52+
53+
override fun toString() =
54+
"DigitalCardArtRetrieveParams{digitalCardArtToken=$digitalCardArtToken, 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 digitalCardArtToken: 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(digitalCardArtRetrieveParams: DigitalCardArtRetrieveParams) = apply {
72+
this.digitalCardArtToken = digitalCardArtRetrieveParams.digitalCardArtToken
73+
additionalQueryParams(digitalCardArtRetrieveParams.additionalQueryParams)
74+
additionalHeaders(digitalCardArtRetrieveParams.additionalHeaders)
75+
}
76+
77+
fun digitalCardArtToken(digitalCardArtToken: String) = apply {
78+
this.digitalCardArtToken = digitalCardArtToken
79+
}
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(): DigitalCardArtRetrieveParams =
122+
DigitalCardArtRetrieveParams(
123+
checkNotNull(digitalCardArtToken) {
124+
"`digitalCardArtToken` is required but was not set"
125+
},
126+
additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
127+
additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
128+
)
129+
}
130+
}

lithic-java-core/src/main/kotlin/com/lithic/api/services/async/DigitalCardArtServiceAsync.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,21 @@
55
package com.lithic.api.services.async
66

77
import com.lithic.api.core.RequestOptions
8+
import com.lithic.api.models.DigitalCardArt
89
import com.lithic.api.models.DigitalCardArtListPageAsync
910
import com.lithic.api.models.DigitalCardArtListParams
11+
import com.lithic.api.models.DigitalCardArtRetrieveParams
1012
import java.util.concurrent.CompletableFuture
1113

1214
interface DigitalCardArtServiceAsync {
1315

16+
/** Get digital card art by token. */
17+
@JvmOverloads
18+
fun retrieve(
19+
params: DigitalCardArtRetrieveParams,
20+
requestOptions: RequestOptions = RequestOptions.none()
21+
): CompletableFuture<DigitalCardArt>
22+
1423
/** List digital card art. */
1524
@JvmOverloads
1625
fun list(

0 commit comments

Comments
 (0)