diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 4a1242df8..774500bfb 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.133.0"
+ ".": "0.134.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 47c7d7549..7abf757c6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 216
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-38a020a15ab14f79c7fea3290822406cf80a9d43d46ab3295632a9723f5e42cd.yml
-openapi_spec_hash: 5a7357a17c5119bc91d8f5e42297fac3
-config_hash: 27fa50e251754c8982e3dc615ef6da41
+configured_endpoints: 221
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-61a059277e4c1eb58cc145be1639732d3d0d79d969742baff98690faf96dc164.yml
+openapi_spec_hash: cc69f6bb4c6d98be95100774de6aff3e
+config_hash: f21cef3cf163623883f344efe9032e4f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b82c81f37..97965c2ef 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,26 @@
# Changelog
+## 0.134.0 (2026-09-18)
+
+Full Changelog: [v0.133.0...v0.134.0](https://github.com/lithic-com/lithic-java/compare/v0.133.0...v0.134.0)
+
+### Features
+
+* [CARDS-5174] Add reiusse/renew 409 error ([3d90574](https://github.com/lithic-com/lithic-java/commit/3d90574a2bd217af7a1e3161c55a17c2d3f7b6bc))
+* [TRE-14464] Update /retry payments endpoint to accept method ([5e294b4](https://github.com/lithic-com/lithic-java/commit/5e294b48832067d094d6c316c239a33bb10a527a))
+* [TRE-14524] Add Open to buy API spec ([b0e8d1f](https://github.com/lithic-com/lithic-java/commit/b0e8d1fba80804352d37aedf40fb809cc4fc2754))
+* Add missing blockchain/stablecoin endpoints to the spec ([5cdc715](https://github.com/lithic-com/lithic-java/commit/5cdc715990d26e494c33d6dfd5bd6581ce21b6c7))
+* **api:** add card.pin_updated webhook event ([8ab17b8](https://github.com/lithic-com/lithic-java/commit/8ab17b8600e670de5baedfb831bf3aa327c3163a))
+* **api:** add EXTERNAL_STABLECOIN category/events to payments and account activity models ([71a8dc7](https://github.com/lithic-com/lithic-java/commit/71a8dc7df0db29dc489ba45c3c677e3d1dbeafa1))
+* **api:** add FEE/FEE_REVERSAL event types to FinancialEvent/ManagementOperation/StatementLineItems ([ea12080](https://github.com/lithic-com/lithic-java/commit/ea12080f1eac92e1a9bdb3c35ed0b67f3bcf3891))
+* **api:** add psd2Context field to ThreeDSAuthentication responses ([5b86204](https://github.com/lithic-com/lithic-java/commit/5b862041a8be447059faa1cdf44fabcc82ae5764))
+* **api:** add retrieve/list installment plan methods to financial_accounts ([d474e8a](https://github.com/lithic-com/lithic-java/commit/d474e8a168c193f57ada6c99cfe20ad09b8a13bf))
+* **api:** add STABLECOIN_REVIEWED simulation type to payment simulate action ([eb203cb](https://github.com/lithic-com/lithic-java/commit/eb203cb3d42ad2e5af7924be34535db8f7ffe936))
+* AUTH-3759: Add DECLINE_SCA_REQUIRED and SCA_REQUIRED enum entries ([816b323](https://github.com/lithic-com/lithic-java/commit/816b3238971ee1e9f6b2997f5a54c7a598959dd9))
+* TRE-14349: add installment plan management operation event types ([97fabed](https://github.com/lithic-com/lithic-java/commit/97fabed2eefe8fe7c76fa4c45a66ed8495a28f9d))
+* TRE-14429: Document the stablecoin payments endpoint ([585fdd5](https://github.com/lithic-com/lithic-java/commit/585fdd50392d686c01877f07189ed696345267c8))
+* **types:** add OTHER enum value to AuthRuleType ([498c5fe](https://github.com/lithic-com/lithic-java/commit/498c5fe9b52733f1723a1f5014b354c0b52a3d3b))
+
## 0.133.0 (2026-08-31)
Full Changelog: [v0.132.0...v0.133.0](https://github.com/lithic-com/lithic-java/compare/v0.132.0...v0.133.0)
diff --git a/README.md b/README.md
index 6843416bd..0c2c1a907 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.133.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.133.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.134.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.134.0)
@@ -22,7 +22,7 @@ Use the Lithic MCP Server to enable AI assistants to interact with this API, all
-The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.133.0).
+The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.134.0).
@@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle
```kotlin
-implementation("com.lithic.api:lithic-java:0.133.0")
+implementation("com.lithic.api:lithic-java:0.134.0")
```
### Maven
@@ -42,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.133.0")
com.lithic.api
lithic-java
- 0.133.0
+ 0.134.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 9d85f0e19..1dda877a1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.133.0" // x-release-please-version
+ version = "0.134.0" // x-release-please-version
}
subprojects {
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
index 0dec1db34..3a1db69cc 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListParams.kt
@@ -414,6 +414,8 @@ private constructor(
@JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP")
+ @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN")
+
@JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER")
@JvmField val EXTERNAL_WIRE = of("EXTERNAL_WIRE")
@@ -453,6 +455,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
EXTERNAL_WIRE,
MANAGEMENT_ADJUSTMENT,
@@ -489,6 +492,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
EXTERNAL_WIRE,
MANAGEMENT_ADJUSTMENT,
@@ -529,6 +533,7 @@ private constructor(
EXTERNAL_CHECK -> Value.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Value.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER
EXTERNAL_WIRE -> Value.EXTERNAL_WIRE
MANAGEMENT_ADJUSTMENT -> Value.MANAGEMENT_ADJUSTMENT
@@ -567,6 +572,7 @@ private constructor(
EXTERNAL_CHECK -> Known.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Known.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER
EXTERNAL_WIRE -> Known.EXTERNAL_WIRE
MANAGEMENT_ADJUSTMENT -> Known.MANAGEMENT_ADJUSTMENT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
index e5bff9e4c..972c5c9d8 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
@@ -1136,6 +1136,8 @@ private constructor(
@JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP")
+ @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN")
+
@JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER")
@JvmField val EXTERNAL_WIRE = of("EXTERNAL_WIRE")
@@ -1175,6 +1177,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
EXTERNAL_WIRE,
MANAGEMENT_ADJUSTMENT,
@@ -1213,6 +1216,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
EXTERNAL_WIRE,
MANAGEMENT_ADJUSTMENT,
@@ -1253,6 +1257,7 @@ private constructor(
EXTERNAL_CHECK -> Value.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Value.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER
EXTERNAL_WIRE -> Value.EXTERNAL_WIRE
MANAGEMENT_ADJUSTMENT -> Value.MANAGEMENT_ADJUSTMENT
@@ -1291,6 +1296,7 @@ private constructor(
EXTERNAL_CHECK -> Known.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Known.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER
EXTERNAL_WIRE -> Known.EXTERNAL_WIRE
MANAGEMENT_ADJUSTMENT -> Known.MANAGEMENT_ADJUSTMENT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
index 7630a2e1e..52fa21012 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityRetrieveTransactionResponse.kt
@@ -1158,6 +1158,8 @@ private constructor(
@JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP")
+ @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN")
+
@JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER")
@JvmField val EXTERNAL_WIRE = of("EXTERNAL_WIRE")
@@ -1197,6 +1199,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
EXTERNAL_WIRE,
MANAGEMENT_ADJUSTMENT,
@@ -1235,6 +1238,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
EXTERNAL_WIRE,
MANAGEMENT_ADJUSTMENT,
@@ -1275,6 +1279,7 @@ private constructor(
EXTERNAL_CHECK -> Value.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Value.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER
EXTERNAL_WIRE -> Value.EXTERNAL_WIRE
MANAGEMENT_ADJUSTMENT -> Value.MANAGEMENT_ADJUSTMENT
@@ -1313,6 +1318,7 @@ private constructor(
EXTERNAL_CHECK -> Known.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Known.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER
EXTERNAL_WIRE -> Known.EXTERNAL_WIRE
MANAGEMENT_ADJUSTMENT -> Known.MANAGEMENT_ADJUSTMENT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
index e3ae59125..b0bcd85b9 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt
@@ -210,6 +210,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or ACH_PAYMENT_UPDATE event
* stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -662,6 +664,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or ACH_PAYMENT_UPDATE
* event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -3254,6 +3258,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or ACH_PAYMENT_UPDATE event
* stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*/
class AuthRuleType @JsonCreator private constructor(private val value: JsonField) :
Enum {
@@ -3280,6 +3286,8 @@ private constructor(
@JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE")
+ @JvmField val OTHER = of("OTHER")
+
@JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
}
@@ -3290,6 +3298,7 @@ private constructor(
MERCHANT_LOCK,
CONDITIONAL_ACTION,
TYPESCRIPT_CODE,
+ OTHER,
}
/**
@@ -3307,6 +3316,7 @@ private constructor(
MERCHANT_LOCK,
CONDITIONAL_ACTION,
TYPESCRIPT_CODE,
+ OTHER,
/**
* An enum member indicating that [AuthRuleType] was instantiated with an unknown value.
*/
@@ -3327,6 +3337,7 @@ private constructor(
MERCHANT_LOCK -> Value.MERCHANT_LOCK
CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE
+ OTHER -> Value.OTHER
else -> Value._UNKNOWN
}
@@ -3346,6 +3357,7 @@ private constructor(
MERCHANT_LOCK -> Known.MERCHANT_LOCK
CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE
+ OTHER -> Known.OTHER
else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
index c0a400f36..f36432fcd 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt
@@ -521,6 +521,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected
@@ -798,6 +800,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type
+ * are read-only; `OTHER` cannot be used when creating a rule.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -1717,6 +1721,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*/
class AuthRuleType
@JsonCreator
@@ -1744,6 +1750,8 @@ private constructor(
@JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE")
+ @JvmField val OTHER = of("OTHER")
+
@JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
}
@@ -1754,6 +1762,7 @@ private constructor(
MERCHANT_LOCK,
CONDITIONAL_ACTION,
TYPESCRIPT_CODE,
+ OTHER,
}
/**
@@ -1772,6 +1781,7 @@ private constructor(
MERCHANT_LOCK,
CONDITIONAL_ACTION,
TYPESCRIPT_CODE,
+ OTHER,
/**
* An enum member indicating that [AuthRuleType] was instantiated with an
* unknown value.
@@ -1793,6 +1803,7 @@ private constructor(
MERCHANT_LOCK -> Value.MERCHANT_LOCK
CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE
+ OTHER -> Value.OTHER
else -> Value._UNKNOWN
}
@@ -1812,6 +1823,7 @@ private constructor(
MERCHANT_LOCK -> Known.MERCHANT_LOCK
CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE
+ OTHER -> Known.OTHER
else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
}
@@ -1972,6 +1984,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected
@@ -2245,6 +2259,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type
+ * are read-only; `OTHER` cannot be used when creating a rule.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -3108,6 +3124,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*/
class AuthRuleType
@JsonCreator
@@ -3135,6 +3153,8 @@ private constructor(
@JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE")
+ @JvmField val OTHER = of("OTHER")
+
@JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
}
@@ -3145,6 +3165,7 @@ private constructor(
MERCHANT_LOCK,
CONDITIONAL_ACTION,
TYPESCRIPT_CODE,
+ OTHER,
}
/**
@@ -3163,6 +3184,7 @@ private constructor(
MERCHANT_LOCK,
CONDITIONAL_ACTION,
TYPESCRIPT_CODE,
+ OTHER,
/**
* An enum member indicating that [AuthRuleType] was instantiated with an
* unknown value.
@@ -3184,6 +3206,7 @@ private constructor(
MERCHANT_LOCK -> Value.MERCHANT_LOCK
CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE
+ OTHER -> Value.OTHER
else -> Value._UNKNOWN
}
@@ -3203,6 +3226,7 @@ private constructor(
MERCHANT_LOCK -> Known.MERCHANT_LOCK
CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE
+ OTHER -> Known.OTHER
else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
}
@@ -3376,6 +3400,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected
@@ -3704,6 +3730,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type
+ * are read-only; `OTHER` cannot be used when creating a rule.
*/
fun type(type: AuthRuleType) = type(JsonField.of(type))
@@ -4663,6 +4691,8 @@ private constructor(
* - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
* ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
* ACH_PAYMENT_UPDATE event stream.
+ * - `OTHER`: A rule whose type is not exposed through this API. Rules of this type are
+ * read-only; `OTHER` cannot be used when creating a rule.
*/
class AuthRuleType
@JsonCreator
@@ -4690,6 +4720,8 @@ private constructor(
@JvmField val TYPESCRIPT_CODE = of("TYPESCRIPT_CODE")
+ @JvmField val OTHER = of("OTHER")
+
@JvmStatic fun of(value: String) = AuthRuleType(JsonField.of(value))
}
@@ -4700,6 +4732,7 @@ private constructor(
MERCHANT_LOCK,
CONDITIONAL_ACTION,
TYPESCRIPT_CODE,
+ OTHER,
}
/**
@@ -4718,6 +4751,7 @@ private constructor(
MERCHANT_LOCK,
CONDITIONAL_ACTION,
TYPESCRIPT_CODE,
+ OTHER,
/**
* An enum member indicating that [AuthRuleType] was instantiated with an
* unknown value.
@@ -4739,6 +4773,7 @@ private constructor(
MERCHANT_LOCK -> Value.MERCHANT_LOCK
CONDITIONAL_ACTION -> Value.CONDITIONAL_ACTION
TYPESCRIPT_CODE -> Value.TYPESCRIPT_CODE
+ OTHER -> Value.OTHER
else -> Value._UNKNOWN
}
@@ -4758,6 +4793,7 @@ private constructor(
MERCHANT_LOCK -> Known.MERCHANT_LOCK
CONDITIONAL_ACTION -> Known.CONDITIONAL_ACTION
TYPESCRIPT_CODE -> Known.TYPESCRIPT_CODE
+ OTHER -> Known.OTHER
else -> throw LithicInvalidDataException("Unknown AuthRuleType: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParams.kt
new file mode 100644
index 000000000..cd0557c62
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/BlockchainRecipientRetrieveParams.kt
@@ -0,0 +1,211 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.Params
+import com.lithic.api.core.http.Headers
+import com.lithic.api.core.http.QueryParams
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Get a blockchain recipient by token
+ *
+ * Use this to poll the `verification_state` after registering an address: a recipient cannot
+ * receive a payout until screening completes and moves it out of `PENDING`
+ */
+class BlockchainRecipientRetrieveParams
+private constructor(
+ private val blockchainRecipientToken: String?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ fun blockchainRecipientToken(): Optional = Optional.ofNullable(blockchainRecipientToken)
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun none(): BlockchainRecipientRetrieveParams = builder().build()
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [BlockchainRecipientRetrieveParams].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BlockchainRecipientRetrieveParams]. */
+ class Builder internal constructor() {
+
+ private var blockchainRecipientToken: String? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(blockchainRecipientRetrieveParams: BlockchainRecipientRetrieveParams) =
+ apply {
+ blockchainRecipientToken =
+ blockchainRecipientRetrieveParams.blockchainRecipientToken
+ additionalHeaders = blockchainRecipientRetrieveParams.additionalHeaders.toBuilder()
+ additionalQueryParams =
+ blockchainRecipientRetrieveParams.additionalQueryParams.toBuilder()
+ }
+
+ fun blockchainRecipientToken(blockchainRecipientToken: String?) = apply {
+ this.blockchainRecipientToken = blockchainRecipientToken
+ }
+
+ /**
+ * Alias for calling [Builder.blockchainRecipientToken] with
+ * `blockchainRecipientToken.orElse(null)`.
+ */
+ fun blockchainRecipientToken(blockchainRecipientToken: Optional) =
+ blockchainRecipientToken(blockchainRecipientToken.getOrNull())
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [BlockchainRecipientRetrieveParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): BlockchainRecipientRetrieveParams =
+ BlockchainRecipientRetrieveParams(
+ blockchainRecipientToken,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> blockchainRecipientToken ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is BlockchainRecipientRetrieveParams &&
+ blockchainRecipientToken == other.blockchainRecipientToken &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(blockchainRecipientToken, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "BlockchainRecipientRetrieveParams{blockchainRecipientToken=$blockchainRecipientToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEvent.kt
new file mode 100644
index 000000000..d672179d4
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardPinUpdatedWebhookEvent.kt
@@ -0,0 +1,749 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.lithic.api.core.Enum
+import com.lithic.api.core.ExcludeMissing
+import com.lithic.api.core.JsonField
+import com.lithic.api.core.JsonMissing
+import com.lithic.api.core.JsonValue
+import com.lithic.api.core.checkRequired
+import com.lithic.api.errors.LithicInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import kotlin.jvm.optionals.getOrNull
+
+class CardPinUpdatedWebhookEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val cardToken: JsonField,
+ private val eventType: JsonField,
+ private val pinStatus: JsonField,
+ private val statusReason: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("card_token") @ExcludeMissing cardToken: JsonField = JsonMissing.of(),
+ @JsonProperty("event_type")
+ @ExcludeMissing
+ eventType: JsonField = JsonMissing.of(),
+ @JsonProperty("pin_status")
+ @ExcludeMissing
+ pinStatus: JsonField = JsonMissing.of(),
+ @JsonProperty("status_reason")
+ @ExcludeMissing
+ statusReason: JsonField = JsonMissing.of(),
+ ) : this(cardToken, eventType, pinStatus, statusReason, mutableMapOf())
+
+ /**
+ * The token of the card whose PIN or PIN status was updated
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun cardToken(): String = cardToken.getRequired("card_token")
+
+ /**
+ * The type of event that occurred.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun eventType(): EventType = eventType.getRequired("event_type")
+
+ /**
+ * The card's PIN status after the update
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun pinStatus(): PinStatus = pinStatus.getRequired("pin_status")
+
+ /**
+ * The reason for the PIN update:
+ * * `PIN_SET` - The PIN was set for the first time; `pin_status` is `OK`
+ * * `PIN_CHANGED` - The PIN was changed, including when changing a blocked PIN; `pin_status` is
+ * `OK`
+ * * `PIN_UNBLOCKED` - The PIN was unblocked without changing it; `pin_status` is `OK`
+ * * `EXCESSIVE_PIN_ATTEMPTS` - The PIN was blocked due to excessive incorrect PIN attempts;
+ * `pin_status` is `BLOCKED`
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun statusReason(): StatusReason = statusReason.getRequired("status_reason")
+
+ /**
+ * Returns the raw JSON value of [cardToken].
+ *
+ * Unlike [cardToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("card_token") @ExcludeMissing fun _cardToken(): JsonField = cardToken
+
+ /**
+ * Returns the raw JSON value of [eventType].
+ *
+ * Unlike [eventType], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("event_type") @ExcludeMissing fun _eventType(): JsonField = eventType
+
+ /**
+ * Returns the raw JSON value of [pinStatus].
+ *
+ * Unlike [pinStatus], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("pin_status") @ExcludeMissing fun _pinStatus(): JsonField = pinStatus
+
+ /**
+ * Returns the raw JSON value of [statusReason].
+ *
+ * Unlike [statusReason], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status_reason")
+ @ExcludeMissing
+ fun _statusReason(): JsonField = statusReason
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [CardPinUpdatedWebhookEvent].
+ *
+ * The following fields are required:
+ * ```java
+ * .cardToken()
+ * .eventType()
+ * .pinStatus()
+ * .statusReason()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CardPinUpdatedWebhookEvent]. */
+ class Builder internal constructor() {
+
+ private var cardToken: JsonField? = null
+ private var eventType: JsonField? = null
+ private var pinStatus: JsonField? = null
+ private var statusReason: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(cardPinUpdatedWebhookEvent: CardPinUpdatedWebhookEvent) = apply {
+ cardToken = cardPinUpdatedWebhookEvent.cardToken
+ eventType = cardPinUpdatedWebhookEvent.eventType
+ pinStatus = cardPinUpdatedWebhookEvent.pinStatus
+ statusReason = cardPinUpdatedWebhookEvent.statusReason
+ additionalProperties = cardPinUpdatedWebhookEvent.additionalProperties.toMutableMap()
+ }
+
+ /** The token of the card whose PIN or PIN status was updated */
+ fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken))
+
+ /**
+ * Sets [Builder.cardToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cardToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken }
+
+ /** The type of event that occurred. */
+ fun eventType(eventType: EventType) = eventType(JsonField.of(eventType))
+
+ /**
+ * Sets [Builder.eventType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.eventType] with a well-typed [EventType] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun eventType(eventType: JsonField) = apply { this.eventType = eventType }
+
+ /** The card's PIN status after the update */
+ fun pinStatus(pinStatus: PinStatus) = pinStatus(JsonField.of(pinStatus))
+
+ /**
+ * Sets [Builder.pinStatus] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.pinStatus] with a well-typed [PinStatus] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun pinStatus(pinStatus: JsonField) = apply { this.pinStatus = pinStatus }
+
+ /**
+ * The reason for the PIN update:
+ * * `PIN_SET` - The PIN was set for the first time; `pin_status` is `OK`
+ * * `PIN_CHANGED` - The PIN was changed, including when changing a blocked PIN;
+ * `pin_status` is `OK`
+ * * `PIN_UNBLOCKED` - The PIN was unblocked without changing it; `pin_status` is `OK`
+ * * `EXCESSIVE_PIN_ATTEMPTS` - The PIN was blocked due to excessive incorrect PIN attempts;
+ * `pin_status` is `BLOCKED`
+ */
+ fun statusReason(statusReason: StatusReason) = statusReason(JsonField.of(statusReason))
+
+ /**
+ * Sets [Builder.statusReason] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.statusReason] with a well-typed [StatusReason] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun statusReason(statusReason: JsonField) = apply {
+ this.statusReason = statusReason
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [CardPinUpdatedWebhookEvent].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .cardToken()
+ * .eventType()
+ * .pinStatus()
+ * .statusReason()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): CardPinUpdatedWebhookEvent =
+ CardPinUpdatedWebhookEvent(
+ checkRequired("cardToken", cardToken),
+ checkRequired("eventType", eventType),
+ checkRequired("pinStatus", pinStatus),
+ checkRequired("statusReason", statusReason),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): CardPinUpdatedWebhookEvent = apply {
+ if (validated) {
+ return@apply
+ }
+
+ cardToken()
+ eventType().validate()
+ pinStatus().validate()
+ statusReason().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (cardToken.asKnown().isPresent) 1 else 0) +
+ (eventType.asKnown().getOrNull()?.validity() ?: 0) +
+ (pinStatus.asKnown().getOrNull()?.validity() ?: 0) +
+ (statusReason.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** The type of event that occurred. */
+ class EventType @JsonCreator private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val CARD_PIN_UPDATED = of("card.pin_updated")
+
+ @JvmStatic fun of(value: String) = EventType(JsonField.of(value))
+ }
+
+ /** An enum containing [EventType]'s known values. */
+ enum class Known {
+ CARD_PIN_UPDATED
+ }
+
+ /**
+ * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [EventType] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ CARD_PIN_UPDATED,
+ /**
+ * An enum member indicating that [EventType] was instantiated with an unknown value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws LithicInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED
+ else -> throw LithicInvalidDataException("Unknown EventType: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for debugging
+ * and generally doesn't throw.
+ *
+ * @throws LithicInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): EventType = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is EventType && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** The card's PIN status after the update */
+ class PinStatus @JsonCreator private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val OK = of("OK")
+
+ @JvmField val BLOCKED = of("BLOCKED")
+
+ @JvmStatic fun of(value: String) = PinStatus(JsonField.of(value))
+ }
+
+ /** An enum containing [PinStatus]'s known values. */
+ enum class Known {
+ OK,
+ BLOCKED,
+ }
+
+ /**
+ * An enum containing [PinStatus]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [PinStatus] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ OK,
+ BLOCKED,
+ /**
+ * An enum member indicating that [PinStatus] was instantiated with an unknown value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ OK -> Value.OK
+ BLOCKED -> Value.BLOCKED
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws LithicInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ OK -> Known.OK
+ BLOCKED -> Known.BLOCKED
+ else -> throw LithicInvalidDataException("Unknown PinStatus: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for debugging
+ * and generally doesn't throw.
+ *
+ * @throws LithicInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): PinStatus = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is PinStatus && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /**
+ * The reason for the PIN update:
+ * * `PIN_SET` - The PIN was set for the first time; `pin_status` is `OK`
+ * * `PIN_CHANGED` - The PIN was changed, including when changing a blocked PIN; `pin_status` is
+ * `OK`
+ * * `PIN_UNBLOCKED` - The PIN was unblocked without changing it; `pin_status` is `OK`
+ * * `EXCESSIVE_PIN_ATTEMPTS` - The PIN was blocked due to excessive incorrect PIN attempts;
+ * `pin_status` is `BLOCKED`
+ */
+ class StatusReason @JsonCreator private constructor(private val value: JsonField) :
+ Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val PIN_SET = of("PIN_SET")
+
+ @JvmField val PIN_CHANGED = of("PIN_CHANGED")
+
+ @JvmField val PIN_UNBLOCKED = of("PIN_UNBLOCKED")
+
+ @JvmField val EXCESSIVE_PIN_ATTEMPTS = of("EXCESSIVE_PIN_ATTEMPTS")
+
+ @JvmStatic fun of(value: String) = StatusReason(JsonField.of(value))
+ }
+
+ /** An enum containing [StatusReason]'s known values. */
+ enum class Known {
+ PIN_SET,
+ PIN_CHANGED,
+ PIN_UNBLOCKED,
+ EXCESSIVE_PIN_ATTEMPTS,
+ }
+
+ /**
+ * An enum containing [StatusReason]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [StatusReason] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ PIN_SET,
+ PIN_CHANGED,
+ PIN_UNBLOCKED,
+ EXCESSIVE_PIN_ATTEMPTS,
+ /**
+ * An enum member indicating that [StatusReason] was instantiated with an unknown value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ PIN_SET -> Value.PIN_SET
+ PIN_CHANGED -> Value.PIN_CHANGED
+ PIN_UNBLOCKED -> Value.PIN_UNBLOCKED
+ EXCESSIVE_PIN_ATTEMPTS -> Value.EXCESSIVE_PIN_ATTEMPTS
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws LithicInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ PIN_SET -> Known.PIN_SET
+ PIN_CHANGED -> Known.PIN_CHANGED
+ PIN_UNBLOCKED -> Known.PIN_UNBLOCKED
+ EXCESSIVE_PIN_ATTEMPTS -> Known.EXCESSIVE_PIN_ATTEMPTS
+ else -> throw LithicInvalidDataException("Unknown StatusReason: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for debugging
+ * and generally doesn't throw.
+ *
+ * @throws LithicInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): StatusReason = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is StatusReason && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is CardPinUpdatedWebhookEvent &&
+ cardToken == other.cardToken &&
+ eventType == other.eventType &&
+ pinStatus == other.pinStatus &&
+ statusReason == other.statusReason &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(cardToken, eventType, pinStatus, statusReason, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "CardPinUpdatedWebhookEvent{cardToken=$cardToken, eventType=$eventType, pinStatus=$pinStatus, statusReason=$statusReason, additionalProperties=$additionalProperties}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt
index 09545c5c3..223c54a0e 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt
@@ -24,7 +24,8 @@ import kotlin.jvm.optionals.getOrNull
* Initiate print and shipment of a duplicate physical card (e.g. card is physically damaged). The
* PAN, expiry, and CVC2 will remain the same and the original card can continue to be used until
* the new card is activated. Only applies to cards of type `PHYSICAL`. A card can be reissued or
- * renewed a total of 8 times.
+ * renewed a total of 8 times. Returns `409` if the card is still ongoing manufacturing when using
+ * Thales as a manufacturer.
*/
class CardReissueParams
private constructor(
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt
index 248bcf9d2..ed1de2970 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt
@@ -29,6 +29,7 @@ import kotlin.jvm.optionals.getOrNull
* `PHYSICAL` card can be reissued or renewed a total of 8 times. For `VIRTUAL`, the card will
* retain the same card token and PAN and receive an updated expiry and CVC2 code. `product_id`,
* `shipping_method`, `shipping_address`, `carrier` are only relevant for renewing `PHYSICAL` cards.
+ * Returns `409` if the card is still ongoing manufacturing when using Thales as a manufacturer.
*/
class CardRenewParams
private constructor(
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt
index fb5a6891b..9c2f276b1 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt
@@ -85,6 +85,8 @@ private constructor(
* - card_transaction.updated: Occurs when a card transaction happens.
* - card.converted: Occurs when a card is converted from virtual to physical cards.
* - card.created: Occurs when a new card is created.
+ * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to
+ * excessive incorrect PIN attempts.
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
@@ -304,6 +306,8 @@ private constructor(
* - card_transaction.updated: Occurs when a card transaction happens.
* - card.converted: Occurs when a card is converted from virtual to physical cards.
* - card.created: Occurs when a new card is created.
+ * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due
+ * to excessive incorrect PIN attempts.
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
@@ -522,6 +526,8 @@ private constructor(
* - card_transaction.updated: Occurs when a card transaction happens.
* - card.converted: Occurs when a card is converted from virtual to physical cards.
* - card.created: Occurs when a new card is created.
+ * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to
+ * excessive incorrect PIN attempts.
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
@@ -656,6 +662,8 @@ private constructor(
@JvmField val CARD_CREATED = of("card.created")
+ @JvmField val CARD_PIN_UPDATED = of("card.pin_updated")
+
@JvmField val CARD_REISSUED = of("card.reissued")
@JvmField val CARD_RENEWED = of("card.renewed")
@@ -779,6 +787,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -852,6 +861,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -930,6 +940,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Value.CARD_CONVERTED
CARD_CREATED -> Value.CARD_CREATED
+ CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
@@ -1011,6 +1022,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Known.CARD_CONVERTED
CARD_CREATED -> Known.CARD_CREATED
+ CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt
index 3b0ffb8cf..527d9d30e 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt
@@ -343,6 +343,8 @@ private constructor(
* - card_transaction.updated: Occurs when a card transaction happens.
* - card.converted: Occurs when a card is converted from virtual to physical cards.
* - card.created: Occurs when a new card is created.
+ * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to
+ * excessive incorrect PIN attempts.
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
@@ -477,6 +479,8 @@ private constructor(
@JvmField val CARD_CREATED = of("card.created")
+ @JvmField val CARD_PIN_UPDATED = of("card.pin_updated")
+
@JvmField val CARD_REISSUED = of("card.reissued")
@JvmField val CARD_RENEWED = of("card.renewed")
@@ -600,6 +604,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -673,6 +678,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -751,6 +757,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Value.CARD_CONVERTED
CARD_CREATED -> Value.CARD_CREATED
+ CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
@@ -832,6 +839,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Known.CARD_CONVERTED
CARD_CREATED -> Known.CARD_CREATED
+ CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt
index 1ac9217f3..39d0b0c10 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt
@@ -353,6 +353,8 @@ private constructor(
* - card_transaction.updated: Occurs when a card transaction happens.
* - card.converted: Occurs when a card is converted from virtual to physical cards.
* - card.created: Occurs when a new card is created.
+ * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to
+ * excessive incorrect PIN attempts.
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
@@ -487,6 +489,8 @@ private constructor(
@JvmField val CARD_CREATED = of("card.created")
+ @JvmField val CARD_PIN_UPDATED = of("card.pin_updated")
+
@JvmField val CARD_REISSUED = of("card.reissued")
@JvmField val CARD_RENEWED = of("card.renewed")
@@ -610,6 +614,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -683,6 +688,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -761,6 +767,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Value.CARD_CONVERTED
CARD_CREATED -> Value.CARD_CREATED
+ CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
@@ -842,6 +849,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Known.CARD_CONVERTED
CARD_CREATED -> Known.CARD_CREATED
+ CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt
index 120a4e9c0..729baa419 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt
@@ -676,6 +676,8 @@ private constructor(
* - card_transaction.updated: Occurs when a card transaction happens.
* - card.converted: Occurs when a card is converted from virtual to physical cards.
* - card.created: Occurs when a new card is created.
+ * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to
+ * excessive incorrect PIN attempts.
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
@@ -810,6 +812,8 @@ private constructor(
@JvmField val CARD_CREATED = of("card.created")
+ @JvmField val CARD_PIN_UPDATED = of("card.pin_updated")
+
@JvmField val CARD_REISSUED = of("card.reissued")
@JvmField val CARD_RENEWED = of("card.renewed")
@@ -933,6 +937,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -1006,6 +1011,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -1084,6 +1090,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Value.CARD_CONVERTED
CARD_CREATED -> Value.CARD_CREATED
+ CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
@@ -1165,6 +1172,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Known.CARD_CONVERTED
CARD_CREATED -> Known.CARD_CREATED
+ CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt
index 0bee59c6c..094ce1721 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt
@@ -471,6 +471,8 @@ private constructor(
@JvmField val CARD_CREATED = of("card.created")
+ @JvmField val CARD_PIN_UPDATED = of("card.pin_updated")
+
@JvmField val CARD_REISSUED = of("card.reissued")
@JvmField val CARD_RENEWED = of("card.renewed")
@@ -594,6 +596,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -667,6 +670,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -745,6 +749,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Value.CARD_CONVERTED
CARD_CREATED -> Value.CARD_CREATED
+ CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
@@ -826,6 +831,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Known.CARD_CONVERTED
CARD_CREATED -> Known.CARD_CREATED
+ CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt
index 91de84e1c..a75dc9eb5 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt
@@ -699,6 +699,8 @@ private constructor(
* - card_transaction.updated: Occurs when a card transaction happens.
* - card.converted: Occurs when a card is converted from virtual to physical cards.
* - card.created: Occurs when a new card is created.
+ * - card.pin_updated: Occurs when a card's PIN is set, changed, unblocked, or blocked due to
+ * excessive incorrect PIN attempts.
* - card.reissued: Occurs when a card is reissued.
* - card.renewed: Occurs when a card is renewed.
* - card.shipped: Occurs when a card is shipped.
@@ -833,6 +835,8 @@ private constructor(
@JvmField val CARD_CREATED = of("card.created")
+ @JvmField val CARD_PIN_UPDATED = of("card.pin_updated")
+
@JvmField val CARD_REISSUED = of("card.reissued")
@JvmField val CARD_RENEWED = of("card.renewed")
@@ -956,6 +960,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -1029,6 +1034,7 @@ private constructor(
CARD_TRANSACTION_UPDATED,
CARD_CONVERTED,
CARD_CREATED,
+ CARD_PIN_UPDATED,
CARD_REISSUED,
CARD_RENEWED,
CARD_SHIPPED,
@@ -1107,6 +1113,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Value.CARD_CONVERTED
CARD_CREATED -> Value.CARD_CREATED
+ CARD_PIN_UPDATED -> Value.CARD_PIN_UPDATED
CARD_REISSUED -> Value.CARD_REISSUED
CARD_RENEWED -> Value.CARD_RENEWED
CARD_SHIPPED -> Value.CARD_SHIPPED
@@ -1188,6 +1195,7 @@ private constructor(
CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED
CARD_CONVERTED -> Known.CARD_CONVERTED
CARD_CREATED -> Known.CARD_CREATED
+ CARD_PIN_UPDATED -> Known.CARD_PIN_UPDATED
CARD_REISSUED -> Known.CARD_REISSUED
CARD_RENEWED -> Known.CARD_RENEWED
CARD_SHIPPED -> Known.CARD_SHIPPED
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt
index 7643d0349..f0a8f0132 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt
@@ -866,6 +866,8 @@ private constructor(
@JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP")
+ @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN")
+
@JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER")
@JvmStatic fun of(value: String) = ExternalPaymentCategory(JsonField.of(value))
@@ -878,6 +880,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
}
@@ -898,6 +901,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
/**
* An enum member indicating that [ExternalPaymentCategory] was instantiated with an
@@ -920,6 +924,7 @@ private constructor(
EXTERNAL_CHECK -> Value.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Value.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER
else -> Value._UNKNOWN
}
@@ -940,6 +945,7 @@ private constructor(
EXTERNAL_CHECK -> Known.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Known.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER
else -> throw LithicInvalidDataException("Unknown ExternalPaymentCategory: $value")
}
@@ -1792,6 +1798,16 @@ private constructor(
@JvmField val EXTERNAL_RTP_RELEASED = of("EXTERNAL_RTP_RELEASED")
+ @JvmField val EXTERNAL_STABLECOIN_INITIATED = of("EXTERNAL_STABLECOIN_INITIATED")
+
+ @JvmField val EXTERNAL_STABLECOIN_CANCELED = of("EXTERNAL_STABLECOIN_CANCELED")
+
+ @JvmField val EXTERNAL_STABLECOIN_SETTLED = of("EXTERNAL_STABLECOIN_SETTLED")
+
+ @JvmField val EXTERNAL_STABLECOIN_REVERSED = of("EXTERNAL_STABLECOIN_REVERSED")
+
+ @JvmField val EXTERNAL_STABLECOIN_RELEASED = of("EXTERNAL_STABLECOIN_RELEASED")
+
@JvmStatic fun of(value: String) = ExternalPaymentEventType(JsonField.of(value))
}
@@ -1827,6 +1843,11 @@ private constructor(
EXTERNAL_RTP_SETTLED,
EXTERNAL_RTP_REVERSED,
EXTERNAL_RTP_RELEASED,
+ EXTERNAL_STABLECOIN_INITIATED,
+ EXTERNAL_STABLECOIN_CANCELED,
+ EXTERNAL_STABLECOIN_SETTLED,
+ EXTERNAL_STABLECOIN_REVERSED,
+ EXTERNAL_STABLECOIN_RELEASED,
}
/**
@@ -1871,6 +1892,11 @@ private constructor(
EXTERNAL_RTP_SETTLED,
EXTERNAL_RTP_REVERSED,
EXTERNAL_RTP_RELEASED,
+ EXTERNAL_STABLECOIN_INITIATED,
+ EXTERNAL_STABLECOIN_CANCELED,
+ EXTERNAL_STABLECOIN_SETTLED,
+ EXTERNAL_STABLECOIN_REVERSED,
+ EXTERNAL_STABLECOIN_RELEASED,
/**
* An enum member indicating that [ExternalPaymentEventType] was instantiated with
* an unknown value.
@@ -1917,6 +1943,11 @@ private constructor(
EXTERNAL_RTP_SETTLED -> Value.EXTERNAL_RTP_SETTLED
EXTERNAL_RTP_REVERSED -> Value.EXTERNAL_RTP_REVERSED
EXTERNAL_RTP_RELEASED -> Value.EXTERNAL_RTP_RELEASED
+ EXTERNAL_STABLECOIN_INITIATED -> Value.EXTERNAL_STABLECOIN_INITIATED
+ EXTERNAL_STABLECOIN_CANCELED -> Value.EXTERNAL_STABLECOIN_CANCELED
+ EXTERNAL_STABLECOIN_SETTLED -> Value.EXTERNAL_STABLECOIN_SETTLED
+ EXTERNAL_STABLECOIN_REVERSED -> Value.EXTERNAL_STABLECOIN_REVERSED
+ EXTERNAL_STABLECOIN_RELEASED -> Value.EXTERNAL_STABLECOIN_RELEASED
else -> Value._UNKNOWN
}
@@ -1961,6 +1992,11 @@ private constructor(
EXTERNAL_RTP_SETTLED -> Known.EXTERNAL_RTP_SETTLED
EXTERNAL_RTP_REVERSED -> Known.EXTERNAL_RTP_REVERSED
EXTERNAL_RTP_RELEASED -> Known.EXTERNAL_RTP_RELEASED
+ EXTERNAL_STABLECOIN_INITIATED -> Known.EXTERNAL_STABLECOIN_INITIATED
+ EXTERNAL_STABLECOIN_CANCELED -> Known.EXTERNAL_STABLECOIN_CANCELED
+ EXTERNAL_STABLECOIN_SETTLED -> Known.EXTERNAL_STABLECOIN_SETTLED
+ EXTERNAL_STABLECOIN_REVERSED -> Known.EXTERNAL_STABLECOIN_REVERSED
+ EXTERNAL_STABLECOIN_RELEASED -> Known.EXTERNAL_STABLECOIN_RELEASED
else ->
throw LithicInvalidDataException("Unknown ExternalPaymentEventType: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt
index 201de3314..9eef74f3a 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentCreateParams.kt
@@ -1006,6 +1006,8 @@ private constructor(
@JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP")
+ @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN")
+
@JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER")
@JvmStatic fun of(value: String) = ExternalPaymentCategory(JsonField.of(value))
@@ -1018,6 +1020,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
}
@@ -1038,6 +1041,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
/**
* An enum member indicating that [ExternalPaymentCategory] was instantiated with an
@@ -1060,6 +1064,7 @@ private constructor(
EXTERNAL_CHECK -> Value.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Value.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER
else -> Value._UNKNOWN
}
@@ -1080,6 +1085,7 @@ private constructor(
EXTERNAL_CHECK -> Known.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Known.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER
else -> throw LithicInvalidDataException("Unknown ExternalPaymentCategory: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListParams.kt
index c4a356486..1969781a5 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListParams.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalPaymentListParams.kt
@@ -386,6 +386,8 @@ private constructor(
@JvmField val EXTERNAL_RTP = of("EXTERNAL_RTP")
+ @JvmField val EXTERNAL_STABLECOIN = of("EXTERNAL_STABLECOIN")
+
@JvmField val EXTERNAL_TRANSFER = of("EXTERNAL_TRANSFER")
@JvmStatic fun of(value: String) = ExternalPaymentCategory(JsonField.of(value))
@@ -398,6 +400,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
}
@@ -418,6 +421,7 @@ private constructor(
EXTERNAL_CHECK,
EXTERNAL_FEDNOW,
EXTERNAL_RTP,
+ EXTERNAL_STABLECOIN,
EXTERNAL_TRANSFER,
/**
* An enum member indicating that [ExternalPaymentCategory] was instantiated with an
@@ -440,6 +444,7 @@ private constructor(
EXTERNAL_CHECK -> Value.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Value.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Value.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Value.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Value.EXTERNAL_TRANSFER
else -> Value._UNKNOWN
}
@@ -460,6 +465,7 @@ private constructor(
EXTERNAL_CHECK -> Known.EXTERNAL_CHECK
EXTERNAL_FEDNOW -> Known.EXTERNAL_FEDNOW
EXTERNAL_RTP -> Known.EXTERNAL_RTP
+ EXTERNAL_STABLECOIN -> Known.EXTERNAL_STABLECOIN
EXTERNAL_TRANSFER -> Known.EXTERNAL_TRANSFER
else -> throw LithicInvalidDataException("Unknown ExternalPaymentCategory: $value")
}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPage.kt
new file mode 100644
index 000000000..321d64134
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPage.kt
@@ -0,0 +1,143 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.AutoPager
+import com.lithic.api.core.Page
+import com.lithic.api.core.checkRequired
+import com.lithic.api.services.blocking.financialAccounts.InstallmentPlanService
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** @see InstallmentPlanService.list */
+class FinancialAccountInstallmentPlanListPage
+private constructor(
+ private val service: InstallmentPlanService,
+ private val params: FinancialAccountInstallmentPlanListParams,
+ private val response: FinancialAccountInstallmentPlanListPageResponse,
+) : Page {
+
+ /**
+ * Delegates to [FinancialAccountInstallmentPlanListPageResponse], but gracefully handles
+ * missing data.
+ *
+ * @see FinancialAccountInstallmentPlanListPageResponse.data
+ */
+ fun data(): List =
+ response._data().getOptional("data").getOrNull() ?: emptyList()
+
+ /**
+ * Delegates to [FinancialAccountInstallmentPlanListPageResponse], but gracefully handles
+ * missing data.
+ *
+ * @see FinancialAccountInstallmentPlanListPageResponse.hasMore
+ */
+ fun hasMore(): Optional = response._hasMore().getOptional("has_more")
+
+ override fun items(): List = data()
+
+ override fun hasNextPage(): Boolean = items().isNotEmpty()
+
+ fun nextPageParams(): FinancialAccountInstallmentPlanListParams =
+ if (params.endingBefore().isPresent) {
+ params.toBuilder().endingBefore(items().first()._token().getOptional("token")).build()
+ } else {
+ params.toBuilder().startingAfter(items().last()._token().getOptional("token")).build()
+ }
+
+ override fun nextPage(): FinancialAccountInstallmentPlanListPage =
+ service.list(nextPageParams())
+
+ fun autoPager(): AutoPager = AutoPager.from(this)
+
+ /** The parameters that were used to request this page. */
+ fun params(): FinancialAccountInstallmentPlanListParams = params
+
+ /** The response that this page was parsed from. */
+ fun response(): FinancialAccountInstallmentPlanListPageResponse = response
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [FinancialAccountInstallmentPlanListPage].
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .params()
+ * .response()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [FinancialAccountInstallmentPlanListPage]. */
+ class Builder internal constructor() {
+
+ private var service: InstallmentPlanService? = null
+ private var params: FinancialAccountInstallmentPlanListParams? = null
+ private var response: FinancialAccountInstallmentPlanListPageResponse? = null
+
+ @JvmSynthetic
+ internal fun from(
+ financialAccountInstallmentPlanListPage: FinancialAccountInstallmentPlanListPage
+ ) = apply {
+ service = financialAccountInstallmentPlanListPage.service
+ params = financialAccountInstallmentPlanListPage.params
+ response = financialAccountInstallmentPlanListPage.response
+ }
+
+ fun service(service: InstallmentPlanService) = apply { this.service = service }
+
+ /** The parameters that were used to request this page. */
+ fun params(params: FinancialAccountInstallmentPlanListParams) = apply {
+ this.params = params
+ }
+
+ /** The response that this page was parsed from. */
+ fun response(response: FinancialAccountInstallmentPlanListPageResponse) = apply {
+ this.response = response
+ }
+
+ /**
+ * Returns an immutable instance of [FinancialAccountInstallmentPlanListPage].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .params()
+ * .response()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): FinancialAccountInstallmentPlanListPage =
+ FinancialAccountInstallmentPlanListPage(
+ checkRequired("service", service),
+ checkRequired("params", params),
+ checkRequired("response", response),
+ )
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is FinancialAccountInstallmentPlanListPage &&
+ service == other.service &&
+ params == other.params &&
+ response == other.response
+ }
+
+ override fun hashCode(): Int = Objects.hash(service, params, response)
+
+ override fun toString() =
+ "FinancialAccountInstallmentPlanListPage{service=$service, params=$params, response=$response}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPageAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPageAsync.kt
new file mode 100644
index 000000000..88fa2e211
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPageAsync.kt
@@ -0,0 +1,159 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.AutoPagerAsync
+import com.lithic.api.core.PageAsync
+import com.lithic.api.core.checkRequired
+import com.lithic.api.services.async.financialAccounts.InstallmentPlanServiceAsync
+import java.util.Objects
+import java.util.Optional
+import java.util.concurrent.CompletableFuture
+import java.util.concurrent.Executor
+import kotlin.jvm.optionals.getOrNull
+
+/** @see InstallmentPlanServiceAsync.list */
+class FinancialAccountInstallmentPlanListPageAsync
+private constructor(
+ private val service: InstallmentPlanServiceAsync,
+ private val streamHandlerExecutor: Executor,
+ private val params: FinancialAccountInstallmentPlanListParams,
+ private val response: FinancialAccountInstallmentPlanListPageResponse,
+) : PageAsync {
+
+ /**
+ * Delegates to [FinancialAccountInstallmentPlanListPageResponse], but gracefully handles
+ * missing data.
+ *
+ * @see FinancialAccountInstallmentPlanListPageResponse.data
+ */
+ fun data(): List =
+ response._data().getOptional("data").getOrNull() ?: emptyList()
+
+ /**
+ * Delegates to [FinancialAccountInstallmentPlanListPageResponse], but gracefully handles
+ * missing data.
+ *
+ * @see FinancialAccountInstallmentPlanListPageResponse.hasMore
+ */
+ fun hasMore(): Optional = response._hasMore().getOptional("has_more")
+
+ override fun items(): List = data()
+
+ override fun hasNextPage(): Boolean = items().isNotEmpty()
+
+ fun nextPageParams(): FinancialAccountInstallmentPlanListParams =
+ if (params.endingBefore().isPresent) {
+ params.toBuilder().endingBefore(items().first()._token().getOptional("token")).build()
+ } else {
+ params.toBuilder().startingAfter(items().last()._token().getOptional("token")).build()
+ }
+
+ override fun nextPage(): CompletableFuture =
+ service.list(nextPageParams())
+
+ fun autoPager(): AutoPagerAsync =
+ AutoPagerAsync.from(this, streamHandlerExecutor)
+
+ /** The parameters that were used to request this page. */
+ fun params(): FinancialAccountInstallmentPlanListParams = params
+
+ /** The response that this page was parsed from. */
+ fun response(): FinancialAccountInstallmentPlanListPageResponse = response
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [FinancialAccountInstallmentPlanListPageAsync].
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .streamHandlerExecutor()
+ * .params()
+ * .response()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [FinancialAccountInstallmentPlanListPageAsync]. */
+ class Builder internal constructor() {
+
+ private var service: InstallmentPlanServiceAsync? = null
+ private var streamHandlerExecutor: Executor? = null
+ private var params: FinancialAccountInstallmentPlanListParams? = null
+ private var response: FinancialAccountInstallmentPlanListPageResponse? = null
+
+ @JvmSynthetic
+ internal fun from(
+ financialAccountInstallmentPlanListPageAsync:
+ FinancialAccountInstallmentPlanListPageAsync
+ ) = apply {
+ service = financialAccountInstallmentPlanListPageAsync.service
+ streamHandlerExecutor =
+ financialAccountInstallmentPlanListPageAsync.streamHandlerExecutor
+ params = financialAccountInstallmentPlanListPageAsync.params
+ response = financialAccountInstallmentPlanListPageAsync.response
+ }
+
+ fun service(service: InstallmentPlanServiceAsync) = apply { this.service = service }
+
+ fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
+ this.streamHandlerExecutor = streamHandlerExecutor
+ }
+
+ /** The parameters that were used to request this page. */
+ fun params(params: FinancialAccountInstallmentPlanListParams) = apply {
+ this.params = params
+ }
+
+ /** The response that this page was parsed from. */
+ fun response(response: FinancialAccountInstallmentPlanListPageResponse) = apply {
+ this.response = response
+ }
+
+ /**
+ * Returns an immutable instance of [FinancialAccountInstallmentPlanListPageAsync].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .service()
+ * .streamHandlerExecutor()
+ * .params()
+ * .response()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): FinancialAccountInstallmentPlanListPageAsync =
+ FinancialAccountInstallmentPlanListPageAsync(
+ checkRequired("service", service),
+ checkRequired("streamHandlerExecutor", streamHandlerExecutor),
+ checkRequired("params", params),
+ checkRequired("response", response),
+ )
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is FinancialAccountInstallmentPlanListPageAsync &&
+ service == other.service &&
+ streamHandlerExecutor == other.streamHandlerExecutor &&
+ params == other.params &&
+ response == other.response
+ }
+
+ override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response)
+
+ override fun toString() =
+ "FinancialAccountInstallmentPlanListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPageResponse.kt
new file mode 100644
index 000000000..990d12f8d
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListPageResponse.kt
@@ -0,0 +1,238 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.lithic.api.core.ExcludeMissing
+import com.lithic.api.core.JsonField
+import com.lithic.api.core.JsonMissing
+import com.lithic.api.core.JsonValue
+import com.lithic.api.core.checkKnown
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.toImmutable
+import com.lithic.api.errors.LithicInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import kotlin.jvm.optionals.getOrNull
+
+class FinancialAccountInstallmentPlanListPageResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val data: JsonField>,
+ private val hasMore: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("data")
+ @ExcludeMissing
+ data: JsonField> = JsonMissing.of(),
+ @JsonProperty("has_more") @ExcludeMissing hasMore: JsonField = JsonMissing.of(),
+ ) : this(data, hasMore, mutableMapOf())
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun data(): List = data.getRequired("data")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun hasMore(): Boolean = hasMore.getRequired("has_more")
+
+ /**
+ * Returns the raw JSON value of [data].
+ *
+ * Unlike [data], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data
+
+ /**
+ * Returns the raw JSON value of [hasMore].
+ *
+ * Unlike [hasMore], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("has_more") @ExcludeMissing fun _hasMore(): JsonField = hasMore
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [FinancialAccountInstallmentPlanListPageResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .data()
+ * .hasMore()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [FinancialAccountInstallmentPlanListPageResponse]. */
+ class Builder internal constructor() {
+
+ private var data: JsonField>? = null
+ private var hasMore: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(
+ financialAccountInstallmentPlanListPageResponse:
+ FinancialAccountInstallmentPlanListPageResponse
+ ) = apply {
+ data = financialAccountInstallmentPlanListPageResponse.data.map { it.toMutableList() }
+ hasMore = financialAccountInstallmentPlanListPageResponse.hasMore
+ additionalProperties =
+ financialAccountInstallmentPlanListPageResponse.additionalProperties.toMutableMap()
+ }
+
+ fun data(data: List) = data(JsonField.of(data))
+
+ /**
+ * Sets [Builder.data] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.data] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun data(data: JsonField>) = apply {
+ this.data = data.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [InstallmentPlan] to [Builder.data].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addData(data: InstallmentPlan) = apply {
+ this.data =
+ (this.data ?: JsonField.of(mutableListOf())).also {
+ checkKnown("data", it).add(data)
+ }
+ }
+
+ fun hasMore(hasMore: Boolean) = hasMore(JsonField.of(hasMore))
+
+ /**
+ * Sets [Builder.hasMore] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.hasMore] with a well-typed [Boolean] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun hasMore(hasMore: JsonField) = apply { this.hasMore = hasMore }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [FinancialAccountInstallmentPlanListPageResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .data()
+ * .hasMore()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): FinancialAccountInstallmentPlanListPageResponse =
+ FinancialAccountInstallmentPlanListPageResponse(
+ checkRequired("data", data).map { it.toImmutable() },
+ checkRequired("hasMore", hasMore),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): FinancialAccountInstallmentPlanListPageResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ data().forEach { it.validate() }
+ hasMore()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (hasMore.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is FinancialAccountInstallmentPlanListPageResponse &&
+ data == other.data &&
+ hasMore == other.hasMore &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(data, hasMore, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "FinancialAccountInstallmentPlanListPageResponse{data=$data, hasMore=$hasMore, additionalProperties=$additionalProperties}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListParams.kt
new file mode 100644
index 000000000..46f3c53d7
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanListParams.kt
@@ -0,0 +1,465 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.lithic.api.core.Enum
+import com.lithic.api.core.JsonField
+import com.lithic.api.core.Params
+import com.lithic.api.core.http.Headers
+import com.lithic.api.core.http.QueryParams
+import com.lithic.api.errors.LithicInvalidDataException
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** List the installment plans for a given financial account. */
+class FinancialAccountInstallmentPlanListParams
+private constructor(
+ private val financialAccountToken: String?,
+ private val endingBefore: String?,
+ private val pageSize: Long?,
+ private val startingAfter: String?,
+ private val state: InstallmentPlanState?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /** Globally unique identifier for financial account. */
+ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken)
+
+ /**
+ * A cursor representing an item's token before which a page of results should end. Used to
+ * retrieve the previous page of results before this item.
+ */
+ fun endingBefore(): Optional = Optional.ofNullable(endingBefore)
+
+ /** Page size (for pagination). */
+ fun pageSize(): Optional = Optional.ofNullable(pageSize)
+
+ /**
+ * A cursor representing an item's token after which a page of results should begin. Used to
+ * retrieve the next page of results after this item.
+ */
+ fun startingAfter(): Optional = Optional.ofNullable(startingAfter)
+
+ /** Only installment plans in this state will be included. */
+ fun state(): Optional = Optional.ofNullable(state)
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun none(): FinancialAccountInstallmentPlanListParams = builder().build()
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [FinancialAccountInstallmentPlanListParams].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [FinancialAccountInstallmentPlanListParams]. */
+ class Builder internal constructor() {
+
+ private var financialAccountToken: String? = null
+ private var endingBefore: String? = null
+ private var pageSize: Long? = null
+ private var startingAfter: String? = null
+ private var state: InstallmentPlanState? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(
+ financialAccountInstallmentPlanListParams: FinancialAccountInstallmentPlanListParams
+ ) = apply {
+ financialAccountToken = financialAccountInstallmentPlanListParams.financialAccountToken
+ endingBefore = financialAccountInstallmentPlanListParams.endingBefore
+ pageSize = financialAccountInstallmentPlanListParams.pageSize
+ startingAfter = financialAccountInstallmentPlanListParams.startingAfter
+ state = financialAccountInstallmentPlanListParams.state
+ additionalHeaders =
+ financialAccountInstallmentPlanListParams.additionalHeaders.toBuilder()
+ additionalQueryParams =
+ financialAccountInstallmentPlanListParams.additionalQueryParams.toBuilder()
+ }
+
+ /** Globally unique identifier for financial account. */
+ fun financialAccountToken(financialAccountToken: String?) = apply {
+ this.financialAccountToken = financialAccountToken
+ }
+
+ /**
+ * Alias for calling [Builder.financialAccountToken] with
+ * `financialAccountToken.orElse(null)`.
+ */
+ fun financialAccountToken(financialAccountToken: Optional) =
+ financialAccountToken(financialAccountToken.getOrNull())
+
+ /**
+ * A cursor representing an item's token before which a page of results should end. Used to
+ * retrieve the previous page of results before this item.
+ */
+ fun endingBefore(endingBefore: String?) = apply { this.endingBefore = endingBefore }
+
+ /** Alias for calling [Builder.endingBefore] with `endingBefore.orElse(null)`. */
+ fun endingBefore(endingBefore: Optional) = endingBefore(endingBefore.getOrNull())
+
+ /** Page size (for pagination). */
+ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize }
+
+ /**
+ * Alias for [Builder.pageSize].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun pageSize(pageSize: Long) = pageSize(pageSize as Long?)
+
+ /** Alias for calling [Builder.pageSize] with `pageSize.orElse(null)`. */
+ fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull())
+
+ /**
+ * A cursor representing an item's token after which a page of results should begin. Used to
+ * retrieve the next page of results after this item.
+ */
+ fun startingAfter(startingAfter: String?) = apply { this.startingAfter = startingAfter }
+
+ /** Alias for calling [Builder.startingAfter] with `startingAfter.orElse(null)`. */
+ fun startingAfter(startingAfter: Optional) =
+ startingAfter(startingAfter.getOrNull())
+
+ /** Only installment plans in this state will be included. */
+ fun state(state: InstallmentPlanState?) = apply { this.state = state }
+
+ /** Alias for calling [Builder.state] with `state.orElse(null)`. */
+ fun state(state: Optional) = state(state.getOrNull())
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [FinancialAccountInstallmentPlanListParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): FinancialAccountInstallmentPlanListParams =
+ FinancialAccountInstallmentPlanListParams(
+ financialAccountToken,
+ endingBefore,
+ pageSize,
+ startingAfter,
+ state,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> financialAccountToken ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams =
+ QueryParams.builder()
+ .apply {
+ endingBefore?.let { put("ending_before", it) }
+ pageSize?.let { put("page_size", it.toString()) }
+ startingAfter?.let { put("starting_after", it) }
+ state?.let { put("state", it.toString()) }
+ putAll(additionalQueryParams)
+ }
+ .build()
+
+ /** Only installment plans in this state will be included. */
+ class InstallmentPlanState
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val PENDING = of("PENDING")
+
+ @JvmField val ACTIVE = of("ACTIVE")
+
+ @JvmField val REBUILD_IN_PROGRESS = of("REBUILD_IN_PROGRESS")
+
+ @JvmField val FULLY_PAID = of("FULLY_PAID")
+
+ @JvmField val CANCELLED = of("CANCELLED")
+
+ @JvmStatic fun of(value: String) = InstallmentPlanState(JsonField.of(value))
+ }
+
+ /** An enum containing [InstallmentPlanState]'s known values. */
+ enum class Known {
+ PENDING,
+ ACTIVE,
+ REBUILD_IN_PROGRESS,
+ FULLY_PAID,
+ CANCELLED,
+ }
+
+ /**
+ * An enum containing [InstallmentPlanState]'s known values, as well as an [_UNKNOWN]
+ * member.
+ *
+ * An instance of [InstallmentPlanState] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ PENDING,
+ ACTIVE,
+ REBUILD_IN_PROGRESS,
+ FULLY_PAID,
+ CANCELLED,
+ /**
+ * An enum member indicating that [InstallmentPlanState] was instantiated with an
+ * unknown value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ PENDING -> Value.PENDING
+ ACTIVE -> Value.ACTIVE
+ REBUILD_IN_PROGRESS -> Value.REBUILD_IN_PROGRESS
+ FULLY_PAID -> Value.FULLY_PAID
+ CANCELLED -> Value.CANCELLED
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws LithicInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ PENDING -> Known.PENDING
+ ACTIVE -> Known.ACTIVE
+ REBUILD_IN_PROGRESS -> Known.REBUILD_IN_PROGRESS
+ FULLY_PAID -> Known.FULLY_PAID
+ CANCELLED -> Known.CANCELLED
+ else -> throw LithicInvalidDataException("Unknown InstallmentPlanState: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for debugging
+ * and generally doesn't throw.
+ *
+ * @throws LithicInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow { LithicInvalidDataException("Value is not a String") }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): InstallmentPlanState = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is InstallmentPlanState && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is FinancialAccountInstallmentPlanListParams &&
+ financialAccountToken == other.financialAccountToken &&
+ endingBefore == other.endingBefore &&
+ pageSize == other.pageSize &&
+ startingAfter == other.startingAfter &&
+ state == other.state &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(
+ financialAccountToken,
+ endingBefore,
+ pageSize,
+ startingAfter,
+ state,
+ additionalHeaders,
+ additionalQueryParams,
+ )
+
+ override fun toString() =
+ "FinancialAccountInstallmentPlanListParams{financialAccountToken=$financialAccountToken, endingBefore=$endingBefore, pageSize=$pageSize, startingAfter=$startingAfter, state=$state, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanRetrieveParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanRetrieveParams.kt
new file mode 100644
index 000000000..f3e8cc259
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountInstallmentPlanRetrieveParams.kt
@@ -0,0 +1,242 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.Params
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.http.Headers
+import com.lithic.api.core.http.QueryParams
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Get a specific installment plan for a given financial account. */
+class FinancialAccountInstallmentPlanRetrieveParams
+private constructor(
+ private val financialAccountToken: String,
+ private val installmentPlanToken: String?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /** Globally unique identifier for financial account. */
+ fun financialAccountToken(): String = financialAccountToken
+
+ /** Globally unique identifier for installment plan. */
+ fun installmentPlanToken(): Optional = Optional.ofNullable(installmentPlanToken)
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [FinancialAccountInstallmentPlanRetrieveParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .financialAccountToken()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [FinancialAccountInstallmentPlanRetrieveParams]. */
+ class Builder internal constructor() {
+
+ private var financialAccountToken: String? = null
+ private var installmentPlanToken: String? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(
+ financialAccountInstallmentPlanRetrieveParams:
+ FinancialAccountInstallmentPlanRetrieveParams
+ ) = apply {
+ financialAccountToken =
+ financialAccountInstallmentPlanRetrieveParams.financialAccountToken
+ installmentPlanToken =
+ financialAccountInstallmentPlanRetrieveParams.installmentPlanToken
+ additionalHeaders =
+ financialAccountInstallmentPlanRetrieveParams.additionalHeaders.toBuilder()
+ additionalQueryParams =
+ financialAccountInstallmentPlanRetrieveParams.additionalQueryParams.toBuilder()
+ }
+
+ /** Globally unique identifier for financial account. */
+ fun financialAccountToken(financialAccountToken: String) = apply {
+ this.financialAccountToken = financialAccountToken
+ }
+
+ /** Globally unique identifier for installment plan. */
+ fun installmentPlanToken(installmentPlanToken: String?) = apply {
+ this.installmentPlanToken = installmentPlanToken
+ }
+
+ /**
+ * Alias for calling [Builder.installmentPlanToken] with
+ * `installmentPlanToken.orElse(null)`.
+ */
+ fun installmentPlanToken(installmentPlanToken: Optional) =
+ installmentPlanToken(installmentPlanToken.getOrNull())
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [FinancialAccountInstallmentPlanRetrieveParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .financialAccountToken()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): FinancialAccountInstallmentPlanRetrieveParams =
+ FinancialAccountInstallmentPlanRetrieveParams(
+ checkRequired("financialAccountToken", financialAccountToken),
+ installmentPlanToken,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> financialAccountToken
+ 1 -> installmentPlanToken ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is FinancialAccountInstallmentPlanRetrieveParams &&
+ financialAccountToken == other.financialAccountToken &&
+ installmentPlanToken == other.installmentPlanToken &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(
+ financialAccountToken,
+ installmentPlanToken,
+ additionalHeaders,
+ additionalQueryParams,
+ )
+
+ override fun toString() =
+ "FinancialAccountInstallmentPlanRetrieveParams{financialAccountToken=$financialAccountToken, installmentPlanToken=$installmentPlanToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountOpenToBuyRetrieveParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountOpenToBuyRetrieveParams.kt
new file mode 100644
index 000000000..1802d79dd
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialAccountOpenToBuyRetrieveParams.kt
@@ -0,0 +1,220 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.lithic.api.core.Params
+import com.lithic.api.core.http.Headers
+import com.lithic.api.core.http.QueryParams
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Get the funds available for card spend backed by a given Security Account, along with the
+ * balances that amount is derived from.
+ *
+ * Open to buy is the amount Lithic authorizes card spend against. It is not a stored balance, so it
+ * is recalculated on every request from the Security Account, the funds held against spend Lithic
+ * has already paid out to the networks on your behalf, and the spend that has not yet been
+ * collected. The accounts that feed the calculation depend on your program setup, so
+ * `summary.settled_funds` is `null` outside Commercial Charge.
+ *
+ * Supported for Commercial Charge, Dynamic Reserve, and Secured Charge programs. Returns `404` if
+ * `financial_account_token` is not a Security Account you own, or if your program setup does not
+ * use an open to buy calculation.
+ */
+class FinancialAccountOpenToBuyRetrieveParams
+private constructor(
+ private val financialAccountToken: String?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken)
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun none(): FinancialAccountOpenToBuyRetrieveParams = builder().build()
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [FinancialAccountOpenToBuyRetrieveParams].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [FinancialAccountOpenToBuyRetrieveParams]. */
+ class Builder internal constructor() {
+
+ private var financialAccountToken: String? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(
+ financialAccountOpenToBuyRetrieveParams: FinancialAccountOpenToBuyRetrieveParams
+ ) = apply {
+ financialAccountToken = financialAccountOpenToBuyRetrieveParams.financialAccountToken
+ additionalHeaders =
+ financialAccountOpenToBuyRetrieveParams.additionalHeaders.toBuilder()
+ additionalQueryParams =
+ financialAccountOpenToBuyRetrieveParams.additionalQueryParams.toBuilder()
+ }
+
+ fun financialAccountToken(financialAccountToken: String?) = apply {
+ this.financialAccountToken = financialAccountToken
+ }
+
+ /**
+ * Alias for calling [Builder.financialAccountToken] with
+ * `financialAccountToken.orElse(null)`.
+ */
+ fun financialAccountToken(financialAccountToken: Optional) =
+ financialAccountToken(financialAccountToken.getOrNull())
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [FinancialAccountOpenToBuyRetrieveParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): FinancialAccountOpenToBuyRetrieveParams =
+ FinancialAccountOpenToBuyRetrieveParams(
+ financialAccountToken,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> financialAccountToken ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is FinancialAccountOpenToBuyRetrieveParams &&
+ financialAccountToken == other.financialAccountToken &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(financialAccountToken, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "FinancialAccountOpenToBuyRetrieveParams{financialAccountToken=$financialAccountToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt
index d7f28b871..0148e166a 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialEvent.kt
@@ -555,6 +555,16 @@ private constructor(
@JvmField val EXTERNAL_RTP_SETTLED = of("EXTERNAL_RTP_SETTLED")
+ @JvmField val EXTERNAL_STABLECOIN_CANCELED = of("EXTERNAL_STABLECOIN_CANCELED")
+
+ @JvmField val EXTERNAL_STABLECOIN_INITIATED = of("EXTERNAL_STABLECOIN_INITIATED")
+
+ @JvmField val EXTERNAL_STABLECOIN_RELEASED = of("EXTERNAL_STABLECOIN_RELEASED")
+
+ @JvmField val EXTERNAL_STABLECOIN_REVERSED = of("EXTERNAL_STABLECOIN_REVERSED")
+
+ @JvmField val EXTERNAL_STABLECOIN_SETTLED = of("EXTERNAL_STABLECOIN_SETTLED")
+
@JvmField val EXTERNAL_TRANSFER_CANCELED = of("EXTERNAL_TRANSFER_CANCELED")
@JvmField val EXTERNAL_TRANSFER_INITIATED = of("EXTERNAL_TRANSFER_INITIATED")
@@ -575,10 +585,18 @@ private constructor(
@JvmField val EXTERNAL_WIRE_SETTLED = of("EXTERNAL_WIRE_SETTLED")
+ @JvmField val FEE = of("FEE")
+
+ @JvmField val FEE_REVERSAL = of("FEE_REVERSAL")
+
@JvmField val FINANCIAL_AUTHORIZATION = of("FINANCIAL_AUTHORIZATION")
@JvmField val FINANCIAL_CREDIT_AUTHORIZATION = of("FINANCIAL_CREDIT_AUTHORIZATION")
+ @JvmField val INSTALLMENT_FEE = of("INSTALLMENT_FEE")
+
+ @JvmField val INSTALLMENT_FEE_REVERSAL = of("INSTALLMENT_FEE_REVERSAL")
+
@JvmField val INTEREST = of("INTEREST")
@JvmField val INTEREST_REVERSAL = of("INTEREST_REVERSAL")
@@ -699,6 +717,11 @@ private constructor(
EXTERNAL_RTP_RELEASED,
EXTERNAL_RTP_REVERSED,
EXTERNAL_RTP_SETTLED,
+ EXTERNAL_STABLECOIN_CANCELED,
+ EXTERNAL_STABLECOIN_INITIATED,
+ EXTERNAL_STABLECOIN_RELEASED,
+ EXTERNAL_STABLECOIN_REVERSED,
+ EXTERNAL_STABLECOIN_SETTLED,
EXTERNAL_TRANSFER_CANCELED,
EXTERNAL_TRANSFER_INITIATED,
EXTERNAL_TRANSFER_RELEASED,
@@ -709,8 +732,12 @@ private constructor(
EXTERNAL_WIRE_RELEASED,
EXTERNAL_WIRE_REVERSED,
EXTERNAL_WIRE_SETTLED,
+ FEE,
+ FEE_REVERSAL,
FINANCIAL_AUTHORIZATION,
FINANCIAL_CREDIT_AUTHORIZATION,
+ INSTALLMENT_FEE,
+ INSTALLMENT_FEE_REVERSAL,
INTEREST,
INTEREST_REVERSAL,
INTERNAL_ADJUSTMENT,
@@ -807,6 +834,11 @@ private constructor(
EXTERNAL_RTP_RELEASED,
EXTERNAL_RTP_REVERSED,
EXTERNAL_RTP_SETTLED,
+ EXTERNAL_STABLECOIN_CANCELED,
+ EXTERNAL_STABLECOIN_INITIATED,
+ EXTERNAL_STABLECOIN_RELEASED,
+ EXTERNAL_STABLECOIN_REVERSED,
+ EXTERNAL_STABLECOIN_SETTLED,
EXTERNAL_TRANSFER_CANCELED,
EXTERNAL_TRANSFER_INITIATED,
EXTERNAL_TRANSFER_RELEASED,
@@ -817,8 +849,12 @@ private constructor(
EXTERNAL_WIRE_RELEASED,
EXTERNAL_WIRE_REVERSED,
EXTERNAL_WIRE_SETTLED,
+ FEE,
+ FEE_REVERSAL,
FINANCIAL_AUTHORIZATION,
FINANCIAL_CREDIT_AUTHORIZATION,
+ INSTALLMENT_FEE,
+ INSTALLMENT_FEE_REVERSAL,
INTEREST,
INTEREST_REVERSAL,
INTERNAL_ADJUSTMENT,
@@ -919,6 +955,11 @@ private constructor(
EXTERNAL_RTP_RELEASED -> Value.EXTERNAL_RTP_RELEASED
EXTERNAL_RTP_REVERSED -> Value.EXTERNAL_RTP_REVERSED
EXTERNAL_RTP_SETTLED -> Value.EXTERNAL_RTP_SETTLED
+ EXTERNAL_STABLECOIN_CANCELED -> Value.EXTERNAL_STABLECOIN_CANCELED
+ EXTERNAL_STABLECOIN_INITIATED -> Value.EXTERNAL_STABLECOIN_INITIATED
+ EXTERNAL_STABLECOIN_RELEASED -> Value.EXTERNAL_STABLECOIN_RELEASED
+ EXTERNAL_STABLECOIN_REVERSED -> Value.EXTERNAL_STABLECOIN_REVERSED
+ EXTERNAL_STABLECOIN_SETTLED -> Value.EXTERNAL_STABLECOIN_SETTLED
EXTERNAL_TRANSFER_CANCELED -> Value.EXTERNAL_TRANSFER_CANCELED
EXTERNAL_TRANSFER_INITIATED -> Value.EXTERNAL_TRANSFER_INITIATED
EXTERNAL_TRANSFER_RELEASED -> Value.EXTERNAL_TRANSFER_RELEASED
@@ -929,8 +970,12 @@ private constructor(
EXTERNAL_WIRE_RELEASED -> Value.EXTERNAL_WIRE_RELEASED
EXTERNAL_WIRE_REVERSED -> Value.EXTERNAL_WIRE_REVERSED
EXTERNAL_WIRE_SETTLED -> Value.EXTERNAL_WIRE_SETTLED
+ FEE -> Value.FEE
+ FEE_REVERSAL -> Value.FEE_REVERSAL
FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION
FINANCIAL_CREDIT_AUTHORIZATION -> Value.FINANCIAL_CREDIT_AUTHORIZATION
+ INSTALLMENT_FEE -> Value.INSTALLMENT_FEE
+ INSTALLMENT_FEE_REVERSAL -> Value.INSTALLMENT_FEE_REVERSAL
INTEREST -> Value.INTEREST
INTEREST_REVERSAL -> Value.INTEREST_REVERSAL
INTERNAL_ADJUSTMENT -> Value.INTERNAL_ADJUSTMENT
@@ -1029,6 +1074,11 @@ private constructor(
EXTERNAL_RTP_RELEASED -> Known.EXTERNAL_RTP_RELEASED
EXTERNAL_RTP_REVERSED -> Known.EXTERNAL_RTP_REVERSED
EXTERNAL_RTP_SETTLED -> Known.EXTERNAL_RTP_SETTLED
+ EXTERNAL_STABLECOIN_CANCELED -> Known.EXTERNAL_STABLECOIN_CANCELED
+ EXTERNAL_STABLECOIN_INITIATED -> Known.EXTERNAL_STABLECOIN_INITIATED
+ EXTERNAL_STABLECOIN_RELEASED -> Known.EXTERNAL_STABLECOIN_RELEASED
+ EXTERNAL_STABLECOIN_REVERSED -> Known.EXTERNAL_STABLECOIN_REVERSED
+ EXTERNAL_STABLECOIN_SETTLED -> Known.EXTERNAL_STABLECOIN_SETTLED
EXTERNAL_TRANSFER_CANCELED -> Known.EXTERNAL_TRANSFER_CANCELED
EXTERNAL_TRANSFER_INITIATED -> Known.EXTERNAL_TRANSFER_INITIATED
EXTERNAL_TRANSFER_RELEASED -> Known.EXTERNAL_TRANSFER_RELEASED
@@ -1039,8 +1089,12 @@ private constructor(
EXTERNAL_WIRE_RELEASED -> Known.EXTERNAL_WIRE_RELEASED
EXTERNAL_WIRE_REVERSED -> Known.EXTERNAL_WIRE_REVERSED
EXTERNAL_WIRE_SETTLED -> Known.EXTERNAL_WIRE_SETTLED
+ FEE -> Known.FEE
+ FEE_REVERSAL -> Known.FEE_REVERSAL
FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION
FINANCIAL_CREDIT_AUTHORIZATION -> Known.FINANCIAL_CREDIT_AUTHORIZATION
+ INSTALLMENT_FEE -> Known.INSTALLMENT_FEE
+ INSTALLMENT_FEE_REVERSAL -> Known.INSTALLMENT_FEE_REVERSAL
INTEREST -> Known.INTEREST
INTEREST_REVERSAL -> Known.INTEREST_REVERSAL
INTERNAL_ADJUSTMENT -> Known.INTERNAL_ADJUSTMENT
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstallmentPlan.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstallmentPlan.kt
new file mode 100644
index 000000000..750322b31
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/InstallmentPlan.kt
@@ -0,0 +1,2175 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.lithic.api.models
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.lithic.api.core.Enum
+import com.lithic.api.core.ExcludeMissing
+import com.lithic.api.core.JsonField
+import com.lithic.api.core.JsonMissing
+import com.lithic.api.core.JsonValue
+import com.lithic.api.core.checkKnown
+import com.lithic.api.core.checkRequired
+import com.lithic.api.core.toImmutable
+import com.lithic.api.errors.LithicInvalidDataException
+import java.time.LocalDate
+import java.time.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class InstallmentPlan
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val token: JsonField,
+ private val closedAt: JsonField,
+ private val created: JsonField,
+ private val feeAmount: JsonField,
+ private val financialAccountToken: JsonField,
+ private val installmentPlanTotal: JsonField,
+ private val installments: JsonField>,
+ private val installmentsOutstanding: JsonField,
+ private val installmentsPaid: JsonField,
+ private val numInstallments: JsonField,
+ private val principalAmount: JsonField,
+ private val sourceAmounts: JsonField,
+ private val sourceId: JsonField,
+ private val sourceType: JsonField,
+ private val startDate: JsonField,
+ private val state: JsonField,
+ private val totalPaid: JsonField,
+ private val updated: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
+ @JsonProperty("closed_at")
+ @ExcludeMissing
+ closedAt: JsonField = JsonMissing.of(),
+ @JsonProperty("created")
+ @ExcludeMissing
+ created: JsonField = JsonMissing.of(),
+ @JsonProperty("fee_amount") @ExcludeMissing feeAmount: JsonField = JsonMissing.of(),
+ @JsonProperty("financial_account_token")
+ @ExcludeMissing
+ financialAccountToken: JsonField = JsonMissing.of(),
+ @JsonProperty("installment_plan_total")
+ @ExcludeMissing
+ installmentPlanTotal: JsonField = JsonMissing.of(),
+ @JsonProperty("installments")
+ @ExcludeMissing
+ installments: JsonField> = JsonMissing.of(),
+ @JsonProperty("installments_outstanding")
+ @ExcludeMissing
+ installmentsOutstanding: JsonField = JsonMissing.of(),
+ @JsonProperty("installments_paid")
+ @ExcludeMissing
+ installmentsPaid: JsonField = JsonMissing.of(),
+ @JsonProperty("num_installments")
+ @ExcludeMissing
+ numInstallments: JsonField = JsonMissing.of(),
+ @JsonProperty("principal_amount")
+ @ExcludeMissing
+ principalAmount: JsonField = JsonMissing.of(),
+ @JsonProperty("source_amounts")
+ @ExcludeMissing
+ sourceAmounts: JsonField = JsonMissing.of(),
+ @JsonProperty("source_id") @ExcludeMissing sourceId: JsonField = JsonMissing.of(),
+ @JsonProperty("source_type")
+ @ExcludeMissing
+ sourceType: JsonField = JsonMissing.of(),
+ @JsonProperty("start_date")
+ @ExcludeMissing
+ startDate: JsonField = JsonMissing.of(),
+ @JsonProperty("state")
+ @ExcludeMissing
+ state: JsonField = JsonMissing.of(),
+ @JsonProperty("total_paid") @ExcludeMissing totalPaid: JsonField = JsonMissing.of(),
+ @JsonProperty("updated")
+ @ExcludeMissing
+ updated: JsonField = JsonMissing.of(),
+ ) : this(
+ token,
+ closedAt,
+ created,
+ feeAmount,
+ financialAccountToken,
+ installmentPlanTotal,
+ installments,
+ installmentsOutstanding,
+ installmentsPaid,
+ numInstallments,
+ principalAmount,
+ sourceAmounts,
+ sourceId,
+ sourceType,
+ startDate,
+ state,
+ totalPaid,
+ updated,
+ mutableMapOf(),
+ )
+
+ /**
+ * Globally unique identifier for an installment plan
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun token(): String = token.getRequired("token")
+
+ /**
+ * Date the plan was paid off or cancelled, or null while it is still open
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun closedAt(): Optional = closedAt.getOptional("closed_at")
+
+ /**
+ * Timestamp of when the installment plan was created
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun created(): OffsetDateTime = created.getRequired("created")
+
+ /**
+ * Enrollment fee charged when the plan was created in cents
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun feeAmount(): Long = feeAmount.getRequired("fee_amount")
+
+ /**
+ * Globally unique identifier for a financial account
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun financialAccountToken(): String =
+ financialAccountToken.getRequired("financial_account_token")
+
+ /**
+ * Total owed on the plan in cents, the principal amount plus the enrollment fee
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun installmentPlanTotal(): Long = installmentPlanTotal.getRequired("installment_plan_total")
+
+ /**
+ * Installments that make up the plan, oldest first
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun installments(): List = installments.getRequired("installments")
+
+ /**
+ * Number of installments that still carry a balance
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun installmentsOutstanding(): Long =
+ installmentsOutstanding.getRequired("installments_outstanding")
+
+ /**
+ * Number of installments that have been paid off
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun installmentsPaid(): Long = installmentsPaid.getRequired("installments_paid")
+
+ /**
+ * Number of installments the plan is broken into
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun numInstallments(): Long = numInstallments.getRequired("num_installments")
+
+ /**
+ * Balance the plan was opened on in cents, excluding the enrollment fee
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun principalAmount(): Long = principalAmount.getRequired("principal_amount")
+
+ /**
+ * Balance the plan was opened on, broken out by category, or null if it was not recorded
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun sourceAmounts(): Optional =
+ sourceAmounts.getOptional("source_amounts")
+
+ /**
+ * Identifier of the record the plan was opened from, such as the closing statement for an
+ * unpaid balance
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun sourceId(): String = sourceId.getRequired("source_id")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun sourceType(): InstallmentPlanSource = sourceType.getRequired("source_type")
+
+ /**
+ * Date the plan was created
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun startDate(): LocalDate = startDate.getRequired("start_date")
+
+ /**
+ * State of the installment plan. A plan is REBUILD_IN_PROGRESS while its loan tapes are being
+ * rebuilt, during which its payment totals are being recomputed and should not be treated as
+ * final
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun state(): InstallmentPlanState = state.getRequired("state")
+
+ /**
+ * Amount paid towards the plan to date in cents
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun totalPaid(): Long = totalPaid.getRequired("total_paid")
+
+ /**
+ * Timestamp of when the installment plan was updated
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun updated(): OffsetDateTime = updated.getRequired("updated")
+
+ /**
+ * Returns the raw JSON value of [token].
+ *
+ * Unlike [token], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token
+
+ /**
+ * Returns the raw JSON value of [closedAt].
+ *
+ * Unlike [closedAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("closed_at") @ExcludeMissing fun _closedAt(): JsonField = closedAt
+
+ /**
+ * Returns the raw JSON value of [created].
+ *
+ * Unlike [created], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("created") @ExcludeMissing fun _created(): JsonField = created
+
+ /**
+ * Returns the raw JSON value of [feeAmount].
+ *
+ * Unlike [feeAmount], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("fee_amount") @ExcludeMissing fun _feeAmount(): JsonField = feeAmount
+
+ /**
+ * Returns the raw JSON value of [financialAccountToken].
+ *
+ * Unlike [financialAccountToken], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("financial_account_token")
+ @ExcludeMissing
+ fun _financialAccountToken(): JsonField = financialAccountToken
+
+ /**
+ * Returns the raw JSON value of [installmentPlanTotal].
+ *
+ * Unlike [installmentPlanTotal], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("installment_plan_total")
+ @ExcludeMissing
+ fun _installmentPlanTotal(): JsonField = installmentPlanTotal
+
+ /**
+ * Returns the raw JSON value of [installments].
+ *
+ * Unlike [installments], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("installments")
+ @ExcludeMissing
+ fun _installments(): JsonField> = installments
+
+ /**
+ * Returns the raw JSON value of [installmentsOutstanding].
+ *
+ * Unlike [installmentsOutstanding], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("installments_outstanding")
+ @ExcludeMissing
+ fun _installmentsOutstanding(): JsonField = installmentsOutstanding
+
+ /**
+ * Returns the raw JSON value of [installmentsPaid].
+ *
+ * Unlike [installmentsPaid], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("installments_paid")
+ @ExcludeMissing
+ fun _installmentsPaid(): JsonField = installmentsPaid
+
+ /**
+ * Returns the raw JSON value of [numInstallments].
+ *
+ * Unlike [numInstallments], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("num_installments")
+ @ExcludeMissing
+ fun _numInstallments(): JsonField = numInstallments
+
+ /**
+ * Returns the raw JSON value of [principalAmount].
+ *
+ * Unlike [principalAmount], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("principal_amount")
+ @ExcludeMissing
+ fun _principalAmount(): JsonField = principalAmount
+
+ /**
+ * Returns the raw JSON value of [sourceAmounts].
+ *
+ * Unlike [sourceAmounts], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("source_amounts")
+ @ExcludeMissing
+ fun _sourceAmounts(): JsonField = sourceAmounts
+
+ /**
+ * Returns the raw JSON value of [sourceId].
+ *
+ * Unlike [sourceId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("source_id") @ExcludeMissing fun _sourceId(): JsonField = sourceId
+
+ /**
+ * Returns the raw JSON value of [sourceType].
+ *
+ * Unlike [sourceType], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("source_type")
+ @ExcludeMissing
+ fun _sourceType(): JsonField = sourceType
+
+ /**
+ * Returns the raw JSON value of [startDate].
+ *
+ * Unlike [startDate], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("start_date") @ExcludeMissing fun _startDate(): JsonField = startDate
+
+ /**
+ * Returns the raw JSON value of [state].
+ *
+ * Unlike [state], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state
+
+ /**
+ * Returns the raw JSON value of [totalPaid].
+ *
+ * Unlike [totalPaid], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("total_paid") @ExcludeMissing fun _totalPaid(): JsonField = totalPaid
+
+ /**
+ * Returns the raw JSON value of [updated].
+ *
+ * Unlike [updated], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [InstallmentPlan].
+ *
+ * The following fields are required:
+ * ```java
+ * .token()
+ * .closedAt()
+ * .created()
+ * .feeAmount()
+ * .financialAccountToken()
+ * .installmentPlanTotal()
+ * .installments()
+ * .installmentsOutstanding()
+ * .installmentsPaid()
+ * .numInstallments()
+ * .principalAmount()
+ * .sourceAmounts()
+ * .sourceId()
+ * .sourceType()
+ * .startDate()
+ * .state()
+ * .totalPaid()
+ * .updated()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InstallmentPlan]. */
+ class Builder internal constructor() {
+
+ private var token: JsonField? = null
+ private var closedAt: JsonField? = null
+ private var created: JsonField? = null
+ private var feeAmount: JsonField? = null
+ private var financialAccountToken: JsonField? = null
+ private var installmentPlanTotal: JsonField? = null
+ private var installments: JsonField>? = null
+ private var installmentsOutstanding: JsonField? = null
+ private var installmentsPaid: JsonField? = null
+ private var numInstallments: JsonField? = null
+ private var principalAmount: JsonField? = null
+ private var sourceAmounts: JsonField? = null
+ private var sourceId: JsonField? = null
+ private var sourceType: JsonField? = null
+ private var startDate: JsonField? = null
+ private var state: JsonField? = null
+ private var totalPaid: JsonField? = null
+ private var updated: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(installmentPlan: InstallmentPlan) = apply {
+ token = installmentPlan.token
+ closedAt = installmentPlan.closedAt
+ created = installmentPlan.created
+ feeAmount = installmentPlan.feeAmount
+ financialAccountToken = installmentPlan.financialAccountToken
+ installmentPlanTotal = installmentPlan.installmentPlanTotal
+ installments = installmentPlan.installments.map { it.toMutableList() }
+ installmentsOutstanding = installmentPlan.installmentsOutstanding
+ installmentsPaid = installmentPlan.installmentsPaid
+ numInstallments = installmentPlan.numInstallments
+ principalAmount = installmentPlan.principalAmount
+ sourceAmounts = installmentPlan.sourceAmounts
+ sourceId = installmentPlan.sourceId
+ sourceType = installmentPlan.sourceType
+ startDate = installmentPlan.startDate
+ state = installmentPlan.state
+ totalPaid = installmentPlan.totalPaid
+ updated = installmentPlan.updated
+ additionalProperties = installmentPlan.additionalProperties.toMutableMap()
+ }
+
+ /** Globally unique identifier for an installment plan */
+ fun token(token: String) = token(JsonField.of(token))
+
+ /**
+ * Sets [Builder.token] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.token] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun token(token: JsonField) = apply { this.token = token }
+
+ /** Date the plan was paid off or cancelled, or null while it is still open */
+ fun closedAt(closedAt: LocalDate?) = closedAt(JsonField.ofNullable(closedAt))
+
+ /** Alias for calling [Builder.closedAt] with `closedAt.orElse(null)`. */
+ fun closedAt(closedAt: Optional) = closedAt(closedAt.getOrNull())
+
+ /**
+ * Sets [Builder.closedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.closedAt] with a well-typed [LocalDate] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun closedAt(closedAt: JsonField) = apply { this.closedAt = closedAt }
+
+ /** Timestamp of when the installment plan was created */
+ fun created(created: OffsetDateTime) = created(JsonField.of(created))
+
+ /**
+ * Sets [Builder.created] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.created] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun created(created: JsonField) = apply { this.created = created }
+
+ /** Enrollment fee charged when the plan was created in cents */
+ fun feeAmount(feeAmount: Long) = feeAmount(JsonField.of(feeAmount))
+
+ /**
+ * Sets [Builder.feeAmount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.feeAmount] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun feeAmount(feeAmount: JsonField) = apply { this.feeAmount = feeAmount }
+
+ /** Globally unique identifier for a financial account */
+ fun financialAccountToken(financialAccountToken: String) =
+ financialAccountToken(JsonField.of(financialAccountToken))
+
+ /**
+ * Sets [Builder.financialAccountToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.financialAccountToken] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun financialAccountToken(financialAccountToken: JsonField) = apply {
+ this.financialAccountToken = financialAccountToken
+ }
+
+ /** Total owed on the plan in cents, the principal amount plus the enrollment fee */
+ fun installmentPlanTotal(installmentPlanTotal: Long) =
+ installmentPlanTotal(JsonField.of(installmentPlanTotal))
+
+ /**
+ * Sets [Builder.installmentPlanTotal] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.installmentPlanTotal] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun installmentPlanTotal(installmentPlanTotal: JsonField) = apply {
+ this.installmentPlanTotal = installmentPlanTotal
+ }
+
+ /** Installments that make up the plan, oldest first */
+ fun installments(installments: List) = installments(JsonField.of(installments))
+
+ /**
+ * Sets [Builder.installments] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.installments] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun installments(installments: JsonField>) = apply {
+ this.installments = installments.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Installment] to [installments].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addInstallment(installment: Installment) = apply {
+ installments =
+ (installments ?: JsonField.of(mutableListOf())).also {
+ checkKnown("installments", it).add(installment)
+ }
+ }
+
+ /** Number of installments that still carry a balance */
+ fun installmentsOutstanding(installmentsOutstanding: Long) =
+ installmentsOutstanding(JsonField.of(installmentsOutstanding))
+
+ /**
+ * Sets [Builder.installmentsOutstanding] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.installmentsOutstanding] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun installmentsOutstanding(installmentsOutstanding: JsonField) = apply {
+ this.installmentsOutstanding = installmentsOutstanding
+ }
+
+ /** Number of installments that have been paid off */
+ fun installmentsPaid(installmentsPaid: Long) =
+ installmentsPaid(JsonField.of(installmentsPaid))
+
+ /**
+ * Sets [Builder.installmentsPaid] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.installmentsPaid] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun installmentsPaid(installmentsPaid: JsonField) = apply {
+ this.installmentsPaid = installmentsPaid
+ }
+
+ /** Number of installments the plan is broken into */
+ fun numInstallments(numInstallments: Long) = numInstallments(JsonField.of(numInstallments))
+
+ /**
+ * Sets [Builder.numInstallments] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.numInstallments] with a well-typed [Long] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun numInstallments(numInstallments: JsonField) = apply {
+ this.numInstallments = numInstallments
+ }
+
+ /** Balance the plan was opened on in cents, excluding the enrollment fee */
+ fun principalAmount(principalAmount: Long) = principalAmount(JsonField.of(principalAmount))
+
+ /**
+ * Sets [Builder.principalAmount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.principalAmount] with a well-typed [Long] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun principalAmount(principalAmount: JsonField) = apply {
+ this.principalAmount = principalAmount
+ }
+
+ /**
+ * Balance the plan was opened on, broken out by category, or null if it was not recorded
+ */
+ fun sourceAmounts(sourceAmounts: TransactionCategoryBalances?) =
+ sourceAmounts(JsonField.ofNullable(sourceAmounts))
+
+ /** Alias for calling [Builder.sourceAmounts] with `sourceAmounts.orElse(null)`. */
+ fun sourceAmounts(sourceAmounts: Optional) =
+ sourceAmounts(sourceAmounts.getOrNull())
+
+ /**
+ * Sets [Builder.sourceAmounts] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.sourceAmounts] with a well-typed
+ * [TransactionCategoryBalances] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun sourceAmounts(sourceAmounts: JsonField) = apply {
+ this.sourceAmounts = sourceAmounts
+ }
+
+ /**
+ * Identifier of the record the plan was opened from, such as the closing statement for an
+ * unpaid balance
+ */
+ fun sourceId(sourceId: String) = sourceId(JsonField.of(sourceId))
+
+ /**
+ * Sets [Builder.sourceId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.sourceId] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun sourceId(sourceId: JsonField) = apply { this.sourceId = sourceId }
+
+ fun sourceType(sourceType: InstallmentPlanSource) = sourceType(JsonField.of(sourceType))
+
+ /**
+ * Sets [Builder.sourceType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.sourceType] with a well-typed [InstallmentPlanSource]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun sourceType(sourceType: JsonField) = apply {
+ this.sourceType = sourceType
+ }
+
+ /** Date the plan was created */
+ fun startDate(startDate: LocalDate) = startDate(JsonField.of(startDate))
+
+ /**
+ * Sets [Builder.startDate] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.startDate] with a well-typed [LocalDate] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun startDate(startDate: JsonField) = apply { this.startDate = startDate }
+
+ /**
+ * State of the installment plan. A plan is REBUILD_IN_PROGRESS while its loan tapes are
+ * being rebuilt, during which its payment totals are being recomputed and should not be
+ * treated as final
+ */
+ fun state(state: InstallmentPlanState) = state(JsonField.of(state))
+
+ /**
+ * Sets [Builder.state] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.state] with a well-typed [InstallmentPlanState] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun state(state: JsonField) = apply { this.state = state }
+
+ /** Amount paid towards the plan to date in cents */
+ fun totalPaid(totalPaid: Long) = totalPaid(JsonField.of(totalPaid))
+
+ /**
+ * Sets [Builder.totalPaid] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.totalPaid] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun totalPaid(totalPaid: JsonField) = apply { this.totalPaid = totalPaid }
+
+ /** Timestamp of when the installment plan was updated */
+ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated))
+
+ /**
+ * Sets [Builder.updated] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.updated] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun updated(updated: JsonField) = apply { this.updated = updated }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [InstallmentPlan].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .token()
+ * .closedAt()
+ * .created()
+ * .feeAmount()
+ * .financialAccountToken()
+ * .installmentPlanTotal()
+ * .installments()
+ * .installmentsOutstanding()
+ * .installmentsPaid()
+ * .numInstallments()
+ * .principalAmount()
+ * .sourceAmounts()
+ * .sourceId()
+ * .sourceType()
+ * .startDate()
+ * .state()
+ * .totalPaid()
+ * .updated()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): InstallmentPlan =
+ InstallmentPlan(
+ checkRequired("token", token),
+ checkRequired("closedAt", closedAt),
+ checkRequired("created", created),
+ checkRequired("feeAmount", feeAmount),
+ checkRequired("financialAccountToken", financialAccountToken),
+ checkRequired("installmentPlanTotal", installmentPlanTotal),
+ checkRequired("installments", installments).map { it.toImmutable() },
+ checkRequired("installmentsOutstanding", installmentsOutstanding),
+ checkRequired("installmentsPaid", installmentsPaid),
+ checkRequired("numInstallments", numInstallments),
+ checkRequired("principalAmount", principalAmount),
+ checkRequired("sourceAmounts", sourceAmounts),
+ checkRequired("sourceId", sourceId),
+ checkRequired("sourceType", sourceType),
+ checkRequired("startDate", startDate),
+ checkRequired("state", state),
+ checkRequired("totalPaid", totalPaid),
+ checkRequired("updated", updated),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws LithicInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): InstallmentPlan = apply {
+ if (validated) {
+ return@apply
+ }
+
+ token()
+ closedAt()
+ created()
+ feeAmount()
+ financialAccountToken()
+ installmentPlanTotal()
+ installments().forEach { it.validate() }
+ installmentsOutstanding()
+ installmentsPaid()
+ numInstallments()
+ principalAmount()
+ sourceAmounts().ifPresent { it.validate() }
+ sourceId()
+ sourceType().validate()
+ startDate()
+ state().validate()
+ totalPaid()
+ updated()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: LithicInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (token.asKnown().isPresent) 1 else 0) +
+ (if (closedAt.asKnown().isPresent) 1 else 0) +
+ (if (created.asKnown().isPresent) 1 else 0) +
+ (if (feeAmount.asKnown().isPresent) 1 else 0) +
+ (if (financialAccountToken.asKnown().isPresent) 1 else 0) +
+ (if (installmentPlanTotal.asKnown().isPresent) 1 else 0) +
+ (installments.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (installmentsOutstanding.asKnown().isPresent) 1 else 0) +
+ (if (installmentsPaid.asKnown().isPresent) 1 else 0) +
+ (if (numInstallments.asKnown().isPresent) 1 else 0) +
+ (if (principalAmount.asKnown().isPresent) 1 else 0) +
+ (sourceAmounts.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (sourceId.asKnown().isPresent) 1 else 0) +
+ (sourceType.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (startDate.asKnown().isPresent) 1 else 0) +
+ (state.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (totalPaid.asKnown().isPresent) 1 else 0) +
+ (if (updated.asKnown().isPresent) 1 else 0)
+
+ class Installment
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val amountDue: JsonField,
+ private val amountDueDetails: JsonField,
+ private val amountOutstanding: JsonField,
+ private val amountOutstandingDetails: JsonField,
+ private val amountPaid: JsonField,
+ private val amountPaidDetails: JsonField,
+ private val dateAssessed: JsonField,
+ private val dueDate: JsonField,
+ private val installmentNum: JsonField,
+ private val paymentDueDate: JsonField,
+ private val payments: JsonField>,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount_due")
+ @ExcludeMissing
+ amountDue: JsonField = JsonMissing.of(),
+ @JsonProperty("amount_due_details")
+ @ExcludeMissing
+ amountDueDetails: JsonField = JsonMissing.of(),
+ @JsonProperty("amount_outstanding")
+ @ExcludeMissing
+ amountOutstanding: JsonField = JsonMissing.of(),
+ @JsonProperty("amount_outstanding_details")
+ @ExcludeMissing
+ amountOutstandingDetails: JsonField = JsonMissing.of(),
+ @JsonProperty("amount_paid")
+ @ExcludeMissing
+ amountPaid: JsonField = JsonMissing.of(),
+ @JsonProperty("amount_paid_details")
+ @ExcludeMissing
+ amountPaidDetails: JsonField = JsonMissing.of(),
+ @JsonProperty("date_assessed")
+ @ExcludeMissing
+ dateAssessed: JsonField = JsonMissing.of(),
+ @JsonProperty("due_date")
+ @ExcludeMissing
+ dueDate: JsonField = JsonMissing.of(),
+ @JsonProperty("installment_num")
+ @ExcludeMissing
+ installmentNum: JsonField = JsonMissing.of(),
+ @JsonProperty("payment_due_date")
+ @ExcludeMissing
+ paymentDueDate: JsonField = JsonMissing.of(),
+ @JsonProperty("payments")
+ @ExcludeMissing
+ payments: JsonField