Skip to content

Commit a10af78

Browse files
stainless-botstainless-app[bot]
authored andcommitted
feat(api): updates (#155)
1 parent 8e39e0f commit a10af78

20 files changed

Lines changed: 766 additions & 5 deletions

.stats.yml

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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,31 +396,37 @@ private constructor(
396396

397397
@JvmField val RESERVE = FinancialAccountType(JsonField.of("RESERVE"))
398398

399+
@JvmField val OPERATING = FinancialAccountType(JsonField.of("OPERATING"))
400+
399401
@JvmStatic fun of(value: String) = FinancialAccountType(JsonField.of(value))
400402
}
401403

402404
enum class Known {
403405
ISSUING,
404406
RESERVE,
407+
OPERATING,
405408
}
406409

407410
enum class Value {
408411
ISSUING,
409412
RESERVE,
413+
OPERATING,
410414
_UNKNOWN,
411415
}
412416

413417
fun value(): Value =
414418
when (this) {
415419
ISSUING -> Value.ISSUING
416420
RESERVE -> Value.RESERVE
421+
OPERATING -> Value.OPERATING
417422
else -> Value._UNKNOWN
418423
}
419424

420425
fun known(): Known =
421426
when (this) {
422427
ISSUING -> Known.ISSUING
423428
RESERVE -> Known.RESERVE
429+
OPERATING -> Known.OPERATING
424430
else -> throw LithicInvalidDataException("Unknown FinancialAccountType: $value")
425431
}
426432

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,31 +400,37 @@ private constructor(
400400

401401
@JvmField val RESERVE = FinancialAccountType(JsonField.of("RESERVE"))
402402

403+
@JvmField val OPERATING = FinancialAccountType(JsonField.of("OPERATING"))
404+
403405
@JvmStatic fun of(value: String) = FinancialAccountType(JsonField.of(value))
404406
}
405407

406408
enum class Known {
407409
ISSUING,
408410
RESERVE,
411+
OPERATING,
409412
}
410413

411414
enum class Value {
412415
ISSUING,
413416
RESERVE,
417+
OPERATING,
414418
_UNKNOWN,
415419
}
416420

417421
fun value(): Value =
418422
when (this) {
419423
ISSUING -> Value.ISSUING
420424
RESERVE -> Value.RESERVE
425+
OPERATING -> Value.OPERATING
421426
else -> Value._UNKNOWN
422427
}
423428

424429
fun known(): Known =
425430
when (this) {
426431
ISSUING -> Known.ISSUING
427432
RESERVE -> Known.RESERVE
433+
OPERATING -> Known.OPERATING
428434
else -> throw LithicInvalidDataException("Unknown FinancialAccountType: $value")
429435
}
430436

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

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ private constructor(
3535
private val lastFour: JsonField<String>,
3636
private val memo: JsonField<String>,
3737
private val pan: JsonField<String>,
38+
private val productId: JsonField<String>,
3839
private val spendLimit: JsonField<Long>,
3940
private val spendLimitDuration: JsonField<SpendLimitDuration>,
4041
private val state: JsonField<State>,
@@ -100,6 +101,13 @@ private constructor(
100101
*/
101102
fun pan(): Optional<String> = Optional.ofNullable(pan.getNullable("pan"))
102103

104+
/**
105+
* Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before use.
106+
* Specifies the configuration (i.e., physical card art) that the card should be manufactured
107+
* with.
108+
*/
109+
fun productId(): Optional<String> = Optional.ofNullable(productId.getNullable("product_id"))
110+
103111
/**
104112
* Amount (in cents) to limit approved authorizations. Transaction requests above the spend
105113
* limit will be declined.
@@ -209,6 +217,13 @@ private constructor(
209217
*/
210218
@JsonProperty("pan") @ExcludeMissing fun _pan() = pan
211219

220+
/**
221+
* Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before use.
222+
* Specifies the configuration (i.e., physical card art) that the card should be manufactured
223+
* with.
224+
*/
225+
@JsonProperty("product_id") @ExcludeMissing fun _productId() = productId
226+
212227
/**
213228
* Amount (in cents) to limit approved authorizations. Transaction requests above the spend
214229
* limit will be declined.
@@ -285,6 +300,7 @@ private constructor(
285300
lastFour()
286301
memo()
287302
pan()
303+
productId()
288304
spendLimit()
289305
spendLimitDuration()
290306
state()
@@ -315,6 +331,7 @@ private constructor(
315331
this.lastFour == other.lastFour &&
316332
this.memo == other.memo &&
317333
this.pan == other.pan &&
334+
this.productId == other.productId &&
318335
this.spendLimit == other.spendLimit &&
319336
this.spendLimitDuration == other.spendLimitDuration &&
320337
this.state == other.state &&
@@ -340,6 +357,7 @@ private constructor(
340357
lastFour,
341358
memo,
342359
pan,
360+
productId,
343361
spendLimit,
344362
spendLimitDuration,
345363
state,
@@ -352,7 +370,7 @@ private constructor(
352370
}
353371

354372
override fun toString() =
355-
"Card{accountToken=$accountToken, authRuleTokens=$authRuleTokens, cardProgramToken=$cardProgramToken, created=$created, cvv=$cvv, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, funding=$funding, hostname=$hostname, lastFour=$lastFour, memo=$memo, pan=$pan, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, token=$token, type=$type, additionalProperties=$additionalProperties}"
373+
"Card{accountToken=$accountToken, authRuleTokens=$authRuleTokens, cardProgramToken=$cardProgramToken, created=$created, cvv=$cvv, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, funding=$funding, hostname=$hostname, lastFour=$lastFour, memo=$memo, pan=$pan, productId=$productId, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, token=$token, type=$type, additionalProperties=$additionalProperties}"
356374

357375
companion object {
358376

@@ -374,6 +392,7 @@ private constructor(
374392
private var lastFour: JsonField<String> = JsonMissing.of()
375393
private var memo: JsonField<String> = JsonMissing.of()
376394
private var pan: JsonField<String> = JsonMissing.of()
395+
private var productId: JsonField<String> = JsonMissing.of()
377396
private var spendLimit: JsonField<Long> = JsonMissing.of()
378397
private var spendLimitDuration: JsonField<SpendLimitDuration> = JsonMissing.of()
379398
private var state: JsonField<State> = JsonMissing.of()
@@ -396,6 +415,7 @@ private constructor(
396415
this.lastFour = card.lastFour
397416
this.memo = card.memo
398417
this.pan = card.pan
418+
this.productId = card.productId
399419
this.spendLimit = card.spendLimit
400420
this.spendLimitDuration = card.spendLimitDuration
401421
this.state = card.state
@@ -543,6 +563,22 @@ private constructor(
543563
@ExcludeMissing
544564
fun pan(pan: JsonField<String>) = apply { this.pan = pan }
545565

566+
/**
567+
* Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before
568+
* use. Specifies the configuration (i.e., physical card art) that the card should be
569+
* manufactured with.
570+
*/
571+
fun productId(productId: String) = productId(JsonField.of(productId))
572+
573+
/**
574+
* Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before
575+
* use. Specifies the configuration (i.e., physical card art) that the card should be
576+
* manufactured with.
577+
*/
578+
@JsonProperty("product_id")
579+
@ExcludeMissing
580+
fun productId(productId: JsonField<String>) = apply { this.productId = productId }
581+
546582
/**
547583
* Amount (in cents) to limit approved authorizations. Transaction requests above the spend
548584
* limit will be declined.
@@ -699,6 +735,7 @@ private constructor(
699735
lastFour,
700736
memo,
701737
pan,
738+
productId,
702739
spendLimit,
703740
spendLimitDuration,
704741
state,

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ private constructor(
2929
private val token: JsonField<String>,
3030
private val type: JsonField<Type>,
3131
private val updated: JsonField<OffsetDateTime>,
32+
private val nickname: JsonField<String>,
3233
private val additionalProperties: Map<String, JsonValue>,
3334
) {
3435

@@ -56,6 +57,9 @@ private constructor(
5657
/** Date and time for when the financial account was last updated. */
5758
fun updated(): OffsetDateTime = updated.getRequired("updated")
5859

60+
/** User-defined nickname for the financial account. */
61+
fun nickname(): Optional<String> = Optional.ofNullable(nickname.getNullable("nickname"))
62+
5963
/** Account number for your Lithic-assigned bank account number, if applicable. */
6064
@JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber
6165

@@ -74,6 +78,9 @@ private constructor(
7478
/** Date and time for when the financial account was last updated. */
7579
@JsonProperty("updated") @ExcludeMissing fun _updated() = updated
7680

81+
/** User-defined nickname for the financial account. */
82+
@JsonProperty("nickname") @ExcludeMissing fun _nickname() = nickname
83+
7784
@JsonAnyGetter
7885
@ExcludeMissing
7986
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
@@ -86,6 +93,7 @@ private constructor(
8693
token()
8794
type()
8895
updated()
96+
nickname()
8997
validated = true
9098
}
9199
}
@@ -104,6 +112,7 @@ private constructor(
104112
this.token == other.token &&
105113
this.type == other.type &&
106114
this.updated == other.updated &&
115+
this.nickname == other.nickname &&
107116
this.additionalProperties == other.additionalProperties
108117
}
109118

@@ -117,14 +126,15 @@ private constructor(
117126
token,
118127
type,
119128
updated,
129+
nickname,
120130
additionalProperties,
121131
)
122132
}
123133
return hashCode
124134
}
125135

126136
override fun toString() =
127-
"FinancialAccount{accountNumber=$accountNumber, created=$created, routingNumber=$routingNumber, token=$token, type=$type, updated=$updated, additionalProperties=$additionalProperties}"
137+
"FinancialAccount{accountNumber=$accountNumber, created=$created, routingNumber=$routingNumber, token=$token, type=$type, updated=$updated, nickname=$nickname, additionalProperties=$additionalProperties}"
128138

129139
companion object {
130140

@@ -139,6 +149,7 @@ private constructor(
139149
private var token: JsonField<String> = JsonMissing.of()
140150
private var type: JsonField<Type> = JsonMissing.of()
141151
private var updated: JsonField<OffsetDateTime> = JsonMissing.of()
152+
private var nickname: JsonField<String> = JsonMissing.of()
142153
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
143154

144155
@JvmSynthetic
@@ -149,6 +160,7 @@ private constructor(
149160
this.token = financialAccount.token
150161
this.type = financialAccount.type
151162
this.updated = financialAccount.updated
163+
this.nickname = financialAccount.nickname
152164
additionalProperties(financialAccount.additionalProperties)
153165
}
154166

@@ -204,6 +216,14 @@ private constructor(
204216
@ExcludeMissing
205217
fun updated(updated: JsonField<OffsetDateTime>) = apply { this.updated = updated }
206218

219+
/** User-defined nickname for the financial account. */
220+
fun nickname(nickname: String) = nickname(JsonField.of(nickname))
221+
222+
/** User-defined nickname for the financial account. */
223+
@JsonProperty("nickname")
224+
@ExcludeMissing
225+
fun nickname(nickname: JsonField<String>) = apply { this.nickname = nickname }
226+
207227
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
208228
this.additionalProperties.clear()
209229
this.additionalProperties.putAll(additionalProperties)
@@ -226,6 +246,7 @@ private constructor(
226246
token,
227247
type,
228248
updated,
249+
nickname,
229250
additionalProperties.toUnmodifiable(),
230251
)
231252
}
@@ -256,31 +277,37 @@ private constructor(
256277

257278
@JvmField val RESERVE = Type(JsonField.of("RESERVE"))
258279

280+
@JvmField val OPERATING = Type(JsonField.of("OPERATING"))
281+
259282
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
260283
}
261284

262285
enum class Known {
263286
ISSUING,
264287
RESERVE,
288+
OPERATING,
265289
}
266290

267291
enum class Value {
268292
ISSUING,
269293
RESERVE,
294+
OPERATING,
270295
_UNKNOWN,
271296
}
272297

273298
fun value(): Value =
274299
when (this) {
275300
ISSUING -> Value.ISSUING
276301
RESERVE -> Value.RESERVE
302+
OPERATING -> Value.OPERATING
277303
else -> Value._UNKNOWN
278304
}
279305

280306
fun known(): Known =
281307
when (this) {
282308
ISSUING -> Known.ISSUING
283309
RESERVE -> Known.RESERVE
310+
OPERATING -> Known.OPERATING
284311
else -> throw LithicInvalidDataException("Unknown Type: $value")
285312
}
286313

0 commit comments

Comments
 (0)