diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 65b6e7b4e..37e997234 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.129.0"
+ ".": "0.130.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 3a6859322..d092e24ac 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 214
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-185b3d93b4e6ed5ae02c32f0bc9133b0ac99dcd1263a12b7aa9ba64e71a5461e.yml
-openapi_spec_hash: 2418116f58a464afdd5611865e860d30
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-47e9f78d22682623e313f1689f5fa7e3420575ff285a14a2f4704c49ffb6b72e.yml
+openapi_spec_hash: 4797fe46d942cb32e648a79015783d01
config_hash: 5bb913c05ebeb301ec925b16e75bb251
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90efa91fb..88d1519c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
# Changelog
+## 0.130.0 (2026-06-23)
+
+Full Changelog: [v0.129.0...v0.130.0](https://github.com/lithic-com/lithic-java/compare/v0.129.0...v0.130.0)
+
+### Features
+
+* **api:** add claim/claim_document webhook event types ([26c0566](https://github.com/lithic-com/lithic-java/commit/26c0566f986cd238d0640b51f4b762afea09757b))
+* **api:** add payment_velocity/consecutive_declines/ach_payment_history/bank_account features ([f51d491](https://github.com/lithic-com/lithic-java/commit/f51d491bf07272f886c03649821feb5cde265dbb))
+
## 0.129.0 (2026-06-22)
Full Changelog: [v0.128.0...v0.129.0](https://github.com/lithic-com/lithic-java/compare/v0.128.0...v0.129.0)
diff --git a/README.md b/README.md
index 0f9664a8b..4aedcced5 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.129.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.129.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.130.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.130.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.129.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.130.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.129.0")
+implementation("com.lithic.api:lithic-java:0.130.0")
```
### Maven
@@ -42,7 +42,7 @@ implementation("com.lithic.api:lithic-java:0.129.0")
com.lithic.api
lithic-java
- 0.129.0
+ 0.130.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 2f1ae6ee0..32e805ce5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.129.0" // x-release-please-version
+ version = "0.130.0" // x-release-please-version
}
subprojects {
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimCreatedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimCreatedWebhookEvent.kt
new file mode 100644
index 000000000..c5301bc1c
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimCreatedWebhookEvent.kt
@@ -0,0 +1,1639 @@
+// 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.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class ClaimCreatedWebhookEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val token: JsonField,
+ private val accountHolderToken: JsonField,
+ private val accountToken: JsonField,
+ private val cardTokens: JsonField>,
+ private val created: JsonField,
+ private val disputedTransactions: JsonField>,
+ private val eventType: JsonField,
+ private val outstandingRequirements: JsonField>,
+ private val reason: JsonField,
+ private val status: JsonField,
+ private val submitted: JsonField,
+ private val updated: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
+ @JsonProperty("account_holder_token")
+ @ExcludeMissing
+ accountHolderToken: JsonField = JsonMissing.of(),
+ @JsonProperty("account_token")
+ @ExcludeMissing
+ accountToken: JsonField = JsonMissing.of(),
+ @JsonProperty("card_tokens")
+ @ExcludeMissing
+ cardTokens: JsonField> = JsonMissing.of(),
+ @JsonProperty("created")
+ @ExcludeMissing
+ created: JsonField = JsonMissing.of(),
+ @JsonProperty("disputed_transactions")
+ @ExcludeMissing
+ disputedTransactions: JsonField> = JsonMissing.of(),
+ @JsonProperty("event_type")
+ @ExcludeMissing
+ eventType: JsonField = JsonMissing.of(),
+ @JsonProperty("outstanding_requirements")
+ @ExcludeMissing
+ outstandingRequirements: JsonField> = JsonMissing.of(),
+ @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("submitted")
+ @ExcludeMissing
+ submitted: JsonField = JsonMissing.of(),
+ @JsonProperty("updated")
+ @ExcludeMissing
+ updated: JsonField = JsonMissing.of(),
+ ) : this(
+ token,
+ accountHolderToken,
+ accountToken,
+ cardTokens,
+ created,
+ disputedTransactions,
+ eventType,
+ outstandingRequirements,
+ reason,
+ status,
+ submitted,
+ updated,
+ mutableMapOf(),
+ )
+
+ /**
+ * Unique identifier for the claim, in UUID format
+ *
+ * @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")
+
+ /**
+ * Token for the account holder that filed the claim
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun accountHolderToken(): Optional =
+ accountHolderToken.getOptional("account_holder_token")
+
+ /**
+ * Token for the account associated with the claim
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun accountToken(): Optional = accountToken.getOptional("account_token")
+
+ /**
+ * Tokens for the cards associated with the disputed transactions
+ *
+ * @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 cardTokens(): List = cardTokens.getRequired("card_tokens")
+
+ /**
+ * When the claim 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")
+
+ /**
+ * Transactions included in this claim
+ *
+ * @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 disputedTransactions(): List =
+ disputedTransactions.getRequired("disputed_transactions")
+
+ /**
+ * 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")
+
+ /**
+ * Requirements that must be fulfilled before the claim can be submitted
+ *
+ * @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 outstandingRequirements(): List =
+ outstandingRequirements.getRequired("outstanding_requirements")
+
+ /**
+ * Dispute reason code provided when creating the claim
+ *
+ * @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 reason(): Reason = reason.getRequired("reason")
+
+ /**
+ * Current lifecycle status of the claim
+ *
+ * @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 status(): Status = status.getRequired("status")
+
+ /**
+ * When the claim was submitted. Null until the claim reaches `SUBMITTED` status
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun submitted(): Optional = submitted.getOptional("submitted")
+
+ /**
+ * When the claim was last 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 [accountHolderToken].
+ *
+ * Unlike [accountHolderToken], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("account_holder_token")
+ @ExcludeMissing
+ fun _accountHolderToken(): JsonField = accountHolderToken
+
+ /**
+ * Returns the raw JSON value of [accountToken].
+ *
+ * Unlike [accountToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("account_token")
+ @ExcludeMissing
+ fun _accountToken(): JsonField = accountToken
+
+ /**
+ * Returns the raw JSON value of [cardTokens].
+ *
+ * Unlike [cardTokens], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("card_tokens")
+ @ExcludeMissing
+ fun _cardTokens(): JsonField> = cardTokens
+
+ /**
+ * 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 [disputedTransactions].
+ *
+ * Unlike [disputedTransactions], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("disputed_transactions")
+ @ExcludeMissing
+ fun _disputedTransactions(): JsonField> = disputedTransactions
+
+ /**
+ * 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 [outstandingRequirements].
+ *
+ * Unlike [outstandingRequirements], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("outstanding_requirements")
+ @ExcludeMissing
+ fun _outstandingRequirements(): JsonField> =
+ outstandingRequirements
+
+ /**
+ * Returns the raw JSON value of [reason].
+ *
+ * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason
+
+ /**
+ * Returns the raw JSON value of [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+
+ /**
+ * Returns the raw JSON value of [submitted].
+ *
+ * Unlike [submitted], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("submitted")
+ @ExcludeMissing
+ fun _submitted(): JsonField = submitted
+
+ /**
+ * 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 [ClaimCreatedWebhookEvent].
+ *
+ * The following fields are required:
+ * ```java
+ * .token()
+ * .accountHolderToken()
+ * .accountToken()
+ * .cardTokens()
+ * .created()
+ * .disputedTransactions()
+ * .eventType()
+ * .outstandingRequirements()
+ * .reason()
+ * .status()
+ * .submitted()
+ * .updated()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [ClaimCreatedWebhookEvent]. */
+ class Builder internal constructor() {
+
+ private var token: JsonField? = null
+ private var accountHolderToken: JsonField? = null
+ private var accountToken: JsonField? = null
+ private var cardTokens: JsonField>? = null
+ private var created: JsonField? = null
+ private var disputedTransactions: JsonField>? = null
+ private var eventType: JsonField? = null
+ private var outstandingRequirements: JsonField>? = null
+ private var reason: JsonField? = null
+ private var status: JsonField? = null
+ private var submitted: JsonField? = null
+ private var updated: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(claimCreatedWebhookEvent: ClaimCreatedWebhookEvent) = apply {
+ token = claimCreatedWebhookEvent.token
+ accountHolderToken = claimCreatedWebhookEvent.accountHolderToken
+ accountToken = claimCreatedWebhookEvent.accountToken
+ cardTokens = claimCreatedWebhookEvent.cardTokens.map { it.toMutableList() }
+ created = claimCreatedWebhookEvent.created
+ disputedTransactions =
+ claimCreatedWebhookEvent.disputedTransactions.map { it.toMutableList() }
+ eventType = claimCreatedWebhookEvent.eventType
+ outstandingRequirements =
+ claimCreatedWebhookEvent.outstandingRequirements.map { it.toMutableList() }
+ reason = claimCreatedWebhookEvent.reason
+ status = claimCreatedWebhookEvent.status
+ submitted = claimCreatedWebhookEvent.submitted
+ updated = claimCreatedWebhookEvent.updated
+ additionalProperties = claimCreatedWebhookEvent.additionalProperties.toMutableMap()
+ }
+
+ /** Unique identifier for the claim, in UUID format */
+ 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 }
+
+ /** Token for the account holder that filed the claim */
+ fun accountHolderToken(accountHolderToken: String?) =
+ accountHolderToken(JsonField.ofNullable(accountHolderToken))
+
+ /**
+ * Alias for calling [Builder.accountHolderToken] with `accountHolderToken.orElse(null)`.
+ */
+ fun accountHolderToken(accountHolderToken: Optional) =
+ accountHolderToken(accountHolderToken.getOrNull())
+
+ /**
+ * Sets [Builder.accountHolderToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.accountHolderToken] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun accountHolderToken(accountHolderToken: JsonField) = apply {
+ this.accountHolderToken = accountHolderToken
+ }
+
+ /** Token for the account associated with the claim */
+ fun accountToken(accountToken: String?) = accountToken(JsonField.ofNullable(accountToken))
+
+ /** Alias for calling [Builder.accountToken] with `accountToken.orElse(null)`. */
+ fun accountToken(accountToken: Optional) = accountToken(accountToken.getOrNull())
+
+ /**
+ * Sets [Builder.accountToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.accountToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun accountToken(accountToken: JsonField) = apply {
+ this.accountToken = accountToken
+ }
+
+ /** Tokens for the cards associated with the disputed transactions */
+ fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens))
+
+ /**
+ * Sets [Builder.cardTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cardTokens] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun cardTokens(cardTokens: JsonField>) = apply {
+ this.cardTokens = cardTokens.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [cardTokens].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addCardToken(cardToken: String) = apply {
+ cardTokens =
+ (cardTokens ?: JsonField.of(mutableListOf())).also {
+ checkKnown("cardTokens", it).add(cardToken)
+ }
+ }
+
+ /** When the claim 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 }
+
+ /** Transactions included in this claim */
+ fun disputedTransactions(disputedTransactions: List) =
+ disputedTransactions(JsonField.of(disputedTransactions))
+
+ /**
+ * Sets [Builder.disputedTransactions] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.disputedTransactions] with a well-typed
+ * `List` value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun disputedTransactions(disputedTransactions: JsonField>) =
+ apply {
+ this.disputedTransactions = disputedTransactions.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [DisputedTransaction] to [disputedTransactions].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addDisputedTransaction(disputedTransaction: DisputedTransaction) = apply {
+ disputedTransactions =
+ (disputedTransactions ?: JsonField.of(mutableListOf())).also {
+ checkKnown("disputedTransactions", it).add(disputedTransaction)
+ }
+ }
+
+ /** 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 }
+
+ /** Requirements that must be fulfilled before the claim can be submitted */
+ fun outstandingRequirements(outstandingRequirements: List) =
+ outstandingRequirements(JsonField.of(outstandingRequirements))
+
+ /**
+ * Sets [Builder.outstandingRequirements] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.outstandingRequirements] with a well-typed
+ * `List` value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun outstandingRequirements(
+ outstandingRequirements: JsonField>
+ ) = apply {
+ this.outstandingRequirements = outstandingRequirements.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [OutstandingRequirement] to [outstandingRequirements].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addOutstandingRequirement(outstandingRequirement: OutstandingRequirement) = apply {
+ outstandingRequirements =
+ (outstandingRequirements ?: JsonField.of(mutableListOf())).also {
+ checkKnown("outstandingRequirements", it).add(outstandingRequirement)
+ }
+ }
+
+ /** Dispute reason code provided when creating the claim */
+ fun reason(reason: Reason) = reason(JsonField.of(reason))
+
+ /**
+ * Sets [Builder.reason] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.reason] with a well-typed [Reason] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun reason(reason: JsonField) = apply { this.reason = reason }
+
+ /** Current lifecycle status of the claim */
+ fun status(status: Status) = status(JsonField.of(status))
+
+ /**
+ * Sets [Builder.status] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.status] with a well-typed [Status] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun status(status: JsonField) = apply { this.status = status }
+
+ /** When the claim was submitted. Null until the claim reaches `SUBMITTED` status */
+ fun submitted(submitted: OffsetDateTime?) = submitted(JsonField.ofNullable(submitted))
+
+ /** Alias for calling [Builder.submitted] with `submitted.orElse(null)`. */
+ fun submitted(submitted: Optional) = submitted(submitted.getOrNull())
+
+ /**
+ * Sets [Builder.submitted] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.submitted] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun submitted(submitted: JsonField) = apply { this.submitted = submitted }
+
+ /** When the claim was last 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 [ClaimCreatedWebhookEvent].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .token()
+ * .accountHolderToken()
+ * .accountToken()
+ * .cardTokens()
+ * .created()
+ * .disputedTransactions()
+ * .eventType()
+ * .outstandingRequirements()
+ * .reason()
+ * .status()
+ * .submitted()
+ * .updated()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): ClaimCreatedWebhookEvent =
+ ClaimCreatedWebhookEvent(
+ checkRequired("token", token),
+ checkRequired("accountHolderToken", accountHolderToken),
+ checkRequired("accountToken", accountToken),
+ checkRequired("cardTokens", cardTokens).map { it.toImmutable() },
+ checkRequired("created", created),
+ checkRequired("disputedTransactions", disputedTransactions).map {
+ it.toImmutable()
+ },
+ checkRequired("eventType", eventType),
+ checkRequired("outstandingRequirements", outstandingRequirements).map {
+ it.toImmutable()
+ },
+ checkRequired("reason", reason),
+ checkRequired("status", status),
+ checkRequired("submitted", submitted),
+ 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(): ClaimCreatedWebhookEvent = apply {
+ if (validated) {
+ return@apply
+ }
+
+ token()
+ accountHolderToken()
+ accountToken()
+ cardTokens()
+ created()
+ disputedTransactions().forEach { it.validate() }
+ eventType().validate()
+ outstandingRequirements().forEach { it.validate() }
+ reason().validate()
+ status().validate()
+ submitted()
+ 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 (accountHolderToken.asKnown().isPresent) 1 else 0) +
+ (if (accountToken.asKnown().isPresent) 1 else 0) +
+ (cardTokens.asKnown().getOrNull()?.size ?: 0) +
+ (if (created.asKnown().isPresent) 1 else 0) +
+ (disputedTransactions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (eventType.asKnown().getOrNull()?.validity() ?: 0) +
+ (outstandingRequirements.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (reason.asKnown().getOrNull()?.validity() ?: 0) +
+ (status.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (submitted.asKnown().isPresent) 1 else 0) +
+ (if (updated.asKnown().isPresent) 1 else 0)
+
+ /** A transaction included in a claim, along with the specific events being disputed. */
+ class DisputedTransaction
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val eventTokens: JsonField>,
+ private val transactionToken: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("event_tokens")
+ @ExcludeMissing
+ eventTokens: JsonField> = JsonMissing.of(),
+ @JsonProperty("transaction_token")
+ @ExcludeMissing
+ transactionToken: JsonField = JsonMissing.of(),
+ ) : this(eventTokens, transactionToken, mutableMapOf())
+
+ /**
+ * Tokens for the specific events within the transaction being disputed. Lithic creates one
+ * dispute per event token
+ *
+ * @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 eventTokens(): List = eventTokens.getRequired("event_tokens")
+
+ /**
+ * Token for the transaction being disputed, in UUID format
+ *
+ * @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 transactionToken(): String = transactionToken.getRequired("transaction_token")
+
+ /**
+ * Returns the raw JSON value of [eventTokens].
+ *
+ * Unlike [eventTokens], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("event_tokens")
+ @ExcludeMissing
+ fun _eventTokens(): JsonField> = eventTokens
+
+ /**
+ * Returns the raw JSON value of [transactionToken].
+ *
+ * Unlike [transactionToken], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("transaction_token")
+ @ExcludeMissing
+ fun _transactionToken(): JsonField = transactionToken
+
+ @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 [DisputedTransaction].
+ *
+ * The following fields are required:
+ * ```java
+ * .eventTokens()
+ * .transactionToken()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [DisputedTransaction]. */
+ class Builder internal constructor() {
+
+ private var eventTokens: JsonField>? = null
+ private var transactionToken: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(disputedTransaction: DisputedTransaction) = apply {
+ eventTokens = disputedTransaction.eventTokens.map { it.toMutableList() }
+ transactionToken = disputedTransaction.transactionToken
+ additionalProperties = disputedTransaction.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * Tokens for the specific events within the transaction being disputed. Lithic creates
+ * one dispute per event token
+ */
+ fun eventTokens(eventTokens: List) = eventTokens(JsonField.of(eventTokens))
+
+ /**
+ * Sets [Builder.eventTokens] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.eventTokens] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun eventTokens(eventTokens: JsonField>) = apply {
+ this.eventTokens = eventTokens.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [eventTokens].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addEventToken(eventToken: String) = apply {
+ eventTokens =
+ (eventTokens ?: JsonField.of(mutableListOf())).also {
+ checkKnown("eventTokens", it).add(eventToken)
+ }
+ }
+
+ /** Token for the transaction being disputed, in UUID format */
+ fun transactionToken(transactionToken: String) =
+ transactionToken(JsonField.of(transactionToken))
+
+ /**
+ * Sets [Builder.transactionToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.transactionToken] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun transactionToken(transactionToken: JsonField) = apply {
+ this.transactionToken = transactionToken
+ }
+
+ 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 [DisputedTransaction].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .eventTokens()
+ * .transactionToken()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): DisputedTransaction =
+ DisputedTransaction(
+ checkRequired("eventTokens", eventTokens).map { it.toImmutable() },
+ checkRequired("transactionToken", transactionToken),
+ 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(): DisputedTransaction = apply {
+ if (validated) {
+ return@apply
+ }
+
+ eventTokens()
+ transactionToken()
+ 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 =
+ (eventTokens.asKnown().getOrNull()?.size ?: 0) +
+ (if (transactionToken.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is DisputedTransaction &&
+ eventTokens == other.eventTokens &&
+ transactionToken == other.transactionToken &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(eventTokens, transactionToken, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "DisputedTransaction{eventTokens=$eventTokens, transactionToken=$transactionToken, additionalProperties=$additionalProperties}"
+ }
+
+ /** 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 CLAIM_CREATED = of("claim.created")
+
+ @JvmStatic fun of(value: String) = EventType(JsonField.of(value))
+ }
+
+ /** An enum containing [EventType]'s known values. */
+ enum class Known {
+ CLAIM_CREATED
+ }
+
+ /**
+ * 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 {
+ CLAIM_CREATED,
+ /**
+ * 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) {
+ CLAIM_CREATED -> Value.CLAIM_CREATED
+ 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) {
+ CLAIM_CREATED -> Known.CLAIM_CREATED
+ 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()
+ }
+
+ class OutstandingRequirement
+ @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 QUESTIONNAIRE = of("QUESTIONNAIRE")
+
+ @JvmField val DOCUMENTS = of("DOCUMENTS")
+
+ @JvmStatic fun of(value: String) = OutstandingRequirement(JsonField.of(value))
+ }
+
+ /** An enum containing [OutstandingRequirement]'s known values. */
+ enum class Known {
+ QUESTIONNAIRE,
+ DOCUMENTS,
+ }
+
+ /**
+ * An enum containing [OutstandingRequirement]'s known values, as well as an [_UNKNOWN]
+ * member.
+ *
+ * An instance of [OutstandingRequirement] 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 {
+ QUESTIONNAIRE,
+ DOCUMENTS,
+ /**
+ * An enum member indicating that [OutstandingRequirement] 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) {
+ QUESTIONNAIRE -> Value.QUESTIONNAIRE
+ DOCUMENTS -> Value.DOCUMENTS
+ 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) {
+ QUESTIONNAIRE -> Known.QUESTIONNAIRE
+ DOCUMENTS -> Known.DOCUMENTS
+ else -> throw LithicInvalidDataException("Unknown OutstandingRequirement: $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(): OutstandingRequirement = 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 OutstandingRequirement && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** Dispute reason code provided when creating the claim */
+ class Reason @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_NOT_PRESENT = of("CARD_NOT_PRESENT")
+
+ @JvmField val CARD_LOST = of("CARD_LOST")
+
+ @JvmField val CARD_STOLEN = of("CARD_STOLEN")
+
+ @JvmField val CARD_NEVER_RECEIVED = of("CARD_NEVER_RECEIVED")
+
+ @JvmField val COUNTERFEIT = of("COUNTERFEIT")
+
+ @JvmField val ACCOUNT_TAKEOVER = of("ACCOUNT_TAKEOVER")
+
+ @JvmField val PRODUCT_NOT_RECEIVED = of("PRODUCT_NOT_RECEIVED")
+
+ @JvmField val NOT_AS_DESCRIBED = of("NOT_AS_DESCRIBED")
+
+ @JvmField val CREDIT_NOT_PROCESSED = of("CREDIT_NOT_PROCESSED")
+
+ @JvmField val CANCELLED_RECURRING = of("CANCELLED_RECURRING")
+
+ @JvmField val PAID_BY_OTHER_MEANS = of("PAID_BY_OTHER_MEANS")
+
+ @JvmField val DUPLICATE_CHARGE = of("DUPLICATE_CHARGE")
+
+ @JvmField val LATE_PRESENTMENT = of("LATE_PRESENTMENT")
+
+ @JvmField val INCORRECT_TRANSACTION_CODE = of("INCORRECT_TRANSACTION_CODE")
+
+ @JvmField val NO_AUTHORIZATION = of("NO_AUTHORIZATION")
+
+ @JvmField val DECLINED = of("DECLINED")
+
+ @JvmField val INCORRECT_AMOUNT = of("INCORRECT_AMOUNT")
+
+ @JvmField val ATM_CASH_NOT_DISPENSED = of("ATM_CASH_NOT_DISPENSED")
+
+ @JvmField val ATM_DEPOSIT_WRONG_AMOUNT = of("ATM_DEPOSIT_WRONG_AMOUNT")
+
+ @JvmField val ATM_DEPOSIT_MISSING = of("ATM_DEPOSIT_MISSING")
+
+ @JvmStatic fun of(value: String) = Reason(JsonField.of(value))
+ }
+
+ /** An enum containing [Reason]'s known values. */
+ enum class Known {
+ CARD_NOT_PRESENT,
+ CARD_LOST,
+ CARD_STOLEN,
+ CARD_NEVER_RECEIVED,
+ COUNTERFEIT,
+ ACCOUNT_TAKEOVER,
+ PRODUCT_NOT_RECEIVED,
+ NOT_AS_DESCRIBED,
+ CREDIT_NOT_PROCESSED,
+ CANCELLED_RECURRING,
+ PAID_BY_OTHER_MEANS,
+ DUPLICATE_CHARGE,
+ LATE_PRESENTMENT,
+ INCORRECT_TRANSACTION_CODE,
+ NO_AUTHORIZATION,
+ DECLINED,
+ INCORRECT_AMOUNT,
+ ATM_CASH_NOT_DISPENSED,
+ ATM_DEPOSIT_WRONG_AMOUNT,
+ ATM_DEPOSIT_MISSING,
+ }
+
+ /**
+ * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Reason] 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_NOT_PRESENT,
+ CARD_LOST,
+ CARD_STOLEN,
+ CARD_NEVER_RECEIVED,
+ COUNTERFEIT,
+ ACCOUNT_TAKEOVER,
+ PRODUCT_NOT_RECEIVED,
+ NOT_AS_DESCRIBED,
+ CREDIT_NOT_PROCESSED,
+ CANCELLED_RECURRING,
+ PAID_BY_OTHER_MEANS,
+ DUPLICATE_CHARGE,
+ LATE_PRESENTMENT,
+ INCORRECT_TRANSACTION_CODE,
+ NO_AUTHORIZATION,
+ DECLINED,
+ INCORRECT_AMOUNT,
+ ATM_CASH_NOT_DISPENSED,
+ ATM_DEPOSIT_WRONG_AMOUNT,
+ ATM_DEPOSIT_MISSING,
+ /** An enum member indicating that [Reason] 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_NOT_PRESENT -> Value.CARD_NOT_PRESENT
+ CARD_LOST -> Value.CARD_LOST
+ CARD_STOLEN -> Value.CARD_STOLEN
+ CARD_NEVER_RECEIVED -> Value.CARD_NEVER_RECEIVED
+ COUNTERFEIT -> Value.COUNTERFEIT
+ ACCOUNT_TAKEOVER -> Value.ACCOUNT_TAKEOVER
+ PRODUCT_NOT_RECEIVED -> Value.PRODUCT_NOT_RECEIVED
+ NOT_AS_DESCRIBED -> Value.NOT_AS_DESCRIBED
+ CREDIT_NOT_PROCESSED -> Value.CREDIT_NOT_PROCESSED
+ CANCELLED_RECURRING -> Value.CANCELLED_RECURRING
+ PAID_BY_OTHER_MEANS -> Value.PAID_BY_OTHER_MEANS
+ DUPLICATE_CHARGE -> Value.DUPLICATE_CHARGE
+ LATE_PRESENTMENT -> Value.LATE_PRESENTMENT
+ INCORRECT_TRANSACTION_CODE -> Value.INCORRECT_TRANSACTION_CODE
+ NO_AUTHORIZATION -> Value.NO_AUTHORIZATION
+ DECLINED -> Value.DECLINED
+ INCORRECT_AMOUNT -> Value.INCORRECT_AMOUNT
+ ATM_CASH_NOT_DISPENSED -> Value.ATM_CASH_NOT_DISPENSED
+ ATM_DEPOSIT_WRONG_AMOUNT -> Value.ATM_DEPOSIT_WRONG_AMOUNT
+ ATM_DEPOSIT_MISSING -> Value.ATM_DEPOSIT_MISSING
+ 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_NOT_PRESENT -> Known.CARD_NOT_PRESENT
+ CARD_LOST -> Known.CARD_LOST
+ CARD_STOLEN -> Known.CARD_STOLEN
+ CARD_NEVER_RECEIVED -> Known.CARD_NEVER_RECEIVED
+ COUNTERFEIT -> Known.COUNTERFEIT
+ ACCOUNT_TAKEOVER -> Known.ACCOUNT_TAKEOVER
+ PRODUCT_NOT_RECEIVED -> Known.PRODUCT_NOT_RECEIVED
+ NOT_AS_DESCRIBED -> Known.NOT_AS_DESCRIBED
+ CREDIT_NOT_PROCESSED -> Known.CREDIT_NOT_PROCESSED
+ CANCELLED_RECURRING -> Known.CANCELLED_RECURRING
+ PAID_BY_OTHER_MEANS -> Known.PAID_BY_OTHER_MEANS
+ DUPLICATE_CHARGE -> Known.DUPLICATE_CHARGE
+ LATE_PRESENTMENT -> Known.LATE_PRESENTMENT
+ INCORRECT_TRANSACTION_CODE -> Known.INCORRECT_TRANSACTION_CODE
+ NO_AUTHORIZATION -> Known.NO_AUTHORIZATION
+ DECLINED -> Known.DECLINED
+ INCORRECT_AMOUNT -> Known.INCORRECT_AMOUNT
+ ATM_CASH_NOT_DISPENSED -> Known.ATM_CASH_NOT_DISPENSED
+ ATM_DEPOSIT_WRONG_AMOUNT -> Known.ATM_DEPOSIT_WRONG_AMOUNT
+ ATM_DEPOSIT_MISSING -> Known.ATM_DEPOSIT_MISSING
+ else -> throw LithicInvalidDataException("Unknown Reason: $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(): Reason = 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 Reason && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** Current lifecycle status of the claim */
+ class Status @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 INITIALIZING = of("INITIALIZING")
+
+ @JvmField val AWAITING_INFO = of("AWAITING_INFO")
+
+ @JvmField val SUBMITTED = of("SUBMITTED")
+
+ @JvmField val RESOLVED = of("RESOLVED")
+
+ @JvmField val ABANDONED = of("ABANDONED")
+
+ @JvmStatic fun of(value: String) = Status(JsonField.of(value))
+ }
+
+ /** An enum containing [Status]'s known values. */
+ enum class Known {
+ INITIALIZING,
+ AWAITING_INFO,
+ SUBMITTED,
+ RESOLVED,
+ ABANDONED,
+ }
+
+ /**
+ * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Status] 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 {
+ INITIALIZING,
+ AWAITING_INFO,
+ SUBMITTED,
+ RESOLVED,
+ ABANDONED,
+ /** An enum member indicating that [Status] 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) {
+ INITIALIZING -> Value.INITIALIZING
+ AWAITING_INFO -> Value.AWAITING_INFO
+ SUBMITTED -> Value.SUBMITTED
+ RESOLVED -> Value.RESOLVED
+ ABANDONED -> Value.ABANDONED
+ 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) {
+ INITIALIZING -> Known.INITIALIZING
+ AWAITING_INFO -> Known.AWAITING_INFO
+ SUBMITTED -> Known.SUBMITTED
+ RESOLVED -> Known.RESOLVED
+ ABANDONED -> Known.ABANDONED
+ else -> throw LithicInvalidDataException("Unknown Status: $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(): Status = 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 Status && 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 ClaimCreatedWebhookEvent &&
+ token == other.token &&
+ accountHolderToken == other.accountHolderToken &&
+ accountToken == other.accountToken &&
+ cardTokens == other.cardTokens &&
+ created == other.created &&
+ disputedTransactions == other.disputedTransactions &&
+ eventType == other.eventType &&
+ outstandingRequirements == other.outstandingRequirements &&
+ reason == other.reason &&
+ status == other.status &&
+ submitted == other.submitted &&
+ updated == other.updated &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ token,
+ accountHolderToken,
+ accountToken,
+ cardTokens,
+ created,
+ disputedTransactions,
+ eventType,
+ outstandingRequirements,
+ reason,
+ status,
+ submitted,
+ updated,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "ClaimCreatedWebhookEvent{token=$token, accountHolderToken=$accountHolderToken, accountToken=$accountToken, cardTokens=$cardTokens, created=$created, disputedTransactions=$disputedTransactions, eventType=$eventType, outstandingRequirements=$outstandingRequirements, reason=$reason, status=$status, submitted=$submitted, updated=$updated, additionalProperties=$additionalProperties}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimDocumentAcceptedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimDocumentAcceptedWebhookEvent.kt
new file mode 100644
index 000000000..3c8e70d76
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimDocumentAcceptedWebhookEvent.kt
@@ -0,0 +1,1442 @@
+// 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.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class ClaimDocumentAcceptedWebhookEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val token: JsonField,
+ private val created: JsonField,
+ private val downloadUrl: JsonField,
+ private val downloadUrlExpiresAt: JsonField,
+ private val eventType: JsonField,
+ private val failureReason: JsonField,
+ private val name: JsonField,
+ private val requirementId: JsonField,
+ private val status: JsonField,
+ private val updated: JsonField,
+ private val uploadConstraints: JsonField,
+ private val uploadUrl: JsonField,
+ private val uploadUrlExpiresAt: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
+ @JsonProperty("created")
+ @ExcludeMissing
+ created: JsonField = JsonMissing.of(),
+ @JsonProperty("download_url")
+ @ExcludeMissing
+ downloadUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("download_url_expires_at")
+ @ExcludeMissing
+ downloadUrlExpiresAt: JsonField = JsonMissing.of(),
+ @JsonProperty("event_type")
+ @ExcludeMissing
+ eventType: JsonField = JsonMissing.of(),
+ @JsonProperty("failure_reason")
+ @ExcludeMissing
+ failureReason: JsonField = JsonMissing.of(),
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ @JsonProperty("requirement_id")
+ @ExcludeMissing
+ requirementId: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("updated")
+ @ExcludeMissing
+ updated: JsonField = JsonMissing.of(),
+ @JsonProperty("upload_constraints")
+ @ExcludeMissing
+ uploadConstraints: JsonField = JsonMissing.of(),
+ @JsonProperty("upload_url") @ExcludeMissing uploadUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("upload_url_expires_at")
+ @ExcludeMissing
+ uploadUrlExpiresAt: JsonField = JsonMissing.of(),
+ ) : this(
+ token,
+ created,
+ downloadUrl,
+ downloadUrlExpiresAt,
+ eventType,
+ failureReason,
+ name,
+ requirementId,
+ status,
+ updated,
+ uploadConstraints,
+ uploadUrl,
+ uploadUrlExpiresAt,
+ mutableMapOf(),
+ )
+
+ /**
+ * Unique identifier for the document, in UUID format
+ *
+ * @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")
+
+ /**
+ * When the document 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")
+
+ /**
+ * Presigned URL for downloading the uploaded document. Available once the document is being
+ * validated or has been accepted (`VALIDATING` or `ACCEPTED`)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun downloadUrl(): Optional = downloadUrl.getOptional("download_url")
+
+ /**
+ * When the download URL expires
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun downloadUrlExpiresAt(): Optional =
+ downloadUrlExpiresAt.getOptional("download_url_expires_at")
+
+ /**
+ * 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")
+
+ /**
+ * Reason the document failed validation. Null unless `status` is `REJECTED`
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun failureReason(): Optional = failureReason.getOptional("failure_reason")
+
+ /**
+ * Name provided when the upload intent 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 name(): String = name.getRequired("name")
+
+ /**
+ * Identifier of the document requirement this document satisfies. Null for supplemental
+ * documents not tied to a specific requirement
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun requirementId(): Optional = requirementId.getOptional("requirement_id")
+
+ /**
+ * Current validation status of the document
+ *
+ * @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 status(): Status = status.getRequired("status")
+
+ /**
+ * When the document was last 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")
+
+ /**
+ * Constraints that an uploaded file must satisfy.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun uploadConstraints(): Optional =
+ uploadConstraints.getOptional("upload_constraints")
+
+ /**
+ * Presigned URL for uploading the file via HTTP PUT. Null after the upload window expires or
+ * after the document has been validated
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun uploadUrl(): Optional = uploadUrl.getOptional("upload_url")
+
+ /**
+ * When the upload URL expires
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun uploadUrlExpiresAt(): Optional =
+ uploadUrlExpiresAt.getOptional("upload_url_expires_at")
+
+ /**
+ * 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 [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 [downloadUrl].
+ *
+ * Unlike [downloadUrl], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("download_url")
+ @ExcludeMissing
+ fun _downloadUrl(): JsonField = downloadUrl
+
+ /**
+ * Returns the raw JSON value of [downloadUrlExpiresAt].
+ *
+ * Unlike [downloadUrlExpiresAt], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("download_url_expires_at")
+ @ExcludeMissing
+ fun _downloadUrlExpiresAt(): JsonField = downloadUrlExpiresAt
+
+ /**
+ * 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 [failureReason].
+ *
+ * Unlike [failureReason], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("failure_reason")
+ @ExcludeMissing
+ fun _failureReason(): JsonField = failureReason
+
+ /**
+ * Returns the raw JSON value of [name].
+ *
+ * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
+
+ /**
+ * Returns the raw JSON value of [requirementId].
+ *
+ * Unlike [requirementId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("requirement_id")
+ @ExcludeMissing
+ fun _requirementId(): JsonField = requirementId
+
+ /**
+ * Returns the raw JSON value of [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+
+ /**
+ * 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
+
+ /**
+ * Returns the raw JSON value of [uploadConstraints].
+ *
+ * Unlike [uploadConstraints], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("upload_constraints")
+ @ExcludeMissing
+ fun _uploadConstraints(): JsonField = uploadConstraints
+
+ /**
+ * Returns the raw JSON value of [uploadUrl].
+ *
+ * Unlike [uploadUrl], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("upload_url") @ExcludeMissing fun _uploadUrl(): JsonField = uploadUrl
+
+ /**
+ * Returns the raw JSON value of [uploadUrlExpiresAt].
+ *
+ * Unlike [uploadUrlExpiresAt], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("upload_url_expires_at")
+ @ExcludeMissing
+ fun _uploadUrlExpiresAt(): JsonField = uploadUrlExpiresAt
+
+ @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
+ * [ClaimDocumentAcceptedWebhookEvent].
+ *
+ * The following fields are required:
+ * ```java
+ * .token()
+ * .created()
+ * .downloadUrl()
+ * .downloadUrlExpiresAt()
+ * .eventType()
+ * .failureReason()
+ * .name()
+ * .requirementId()
+ * .status()
+ * .updated()
+ * .uploadConstraints()
+ * .uploadUrl()
+ * .uploadUrlExpiresAt()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [ClaimDocumentAcceptedWebhookEvent]. */
+ class Builder internal constructor() {
+
+ private var token: JsonField? = null
+ private var created: JsonField? = null
+ private var downloadUrl: JsonField? = null
+ private var downloadUrlExpiresAt: JsonField? = null
+ private var eventType: JsonField? = null
+ private var failureReason: JsonField? = null
+ private var name: JsonField? = null
+ private var requirementId: JsonField? = null
+ private var status: JsonField? = null
+ private var updated: JsonField? = null
+ private var uploadConstraints: JsonField? = null
+ private var uploadUrl: JsonField? = null
+ private var uploadUrlExpiresAt: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(claimDocumentAcceptedWebhookEvent: ClaimDocumentAcceptedWebhookEvent) =
+ apply {
+ token = claimDocumentAcceptedWebhookEvent.token
+ created = claimDocumentAcceptedWebhookEvent.created
+ downloadUrl = claimDocumentAcceptedWebhookEvent.downloadUrl
+ downloadUrlExpiresAt = claimDocumentAcceptedWebhookEvent.downloadUrlExpiresAt
+ eventType = claimDocumentAcceptedWebhookEvent.eventType
+ failureReason = claimDocumentAcceptedWebhookEvent.failureReason
+ name = claimDocumentAcceptedWebhookEvent.name
+ requirementId = claimDocumentAcceptedWebhookEvent.requirementId
+ status = claimDocumentAcceptedWebhookEvent.status
+ updated = claimDocumentAcceptedWebhookEvent.updated
+ uploadConstraints = claimDocumentAcceptedWebhookEvent.uploadConstraints
+ uploadUrl = claimDocumentAcceptedWebhookEvent.uploadUrl
+ uploadUrlExpiresAt = claimDocumentAcceptedWebhookEvent.uploadUrlExpiresAt
+ additionalProperties =
+ claimDocumentAcceptedWebhookEvent.additionalProperties.toMutableMap()
+ }
+
+ /** Unique identifier for the document, in UUID format */
+ 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 }
+
+ /** When the document 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 }
+
+ /**
+ * Presigned URL for downloading the uploaded document. Available once the document is being
+ * validated or has been accepted (`VALIDATING` or `ACCEPTED`)
+ */
+ fun downloadUrl(downloadUrl: String?) = downloadUrl(JsonField.ofNullable(downloadUrl))
+
+ /** Alias for calling [Builder.downloadUrl] with `downloadUrl.orElse(null)`. */
+ fun downloadUrl(downloadUrl: Optional) = downloadUrl(downloadUrl.getOrNull())
+
+ /**
+ * Sets [Builder.downloadUrl] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.downloadUrl] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun downloadUrl(downloadUrl: JsonField) = apply { this.downloadUrl = downloadUrl }
+
+ /** When the download URL expires */
+ fun downloadUrlExpiresAt(downloadUrlExpiresAt: OffsetDateTime?) =
+ downloadUrlExpiresAt(JsonField.ofNullable(downloadUrlExpiresAt))
+
+ /**
+ * Alias for calling [Builder.downloadUrlExpiresAt] with
+ * `downloadUrlExpiresAt.orElse(null)`.
+ */
+ fun downloadUrlExpiresAt(downloadUrlExpiresAt: Optional) =
+ downloadUrlExpiresAt(downloadUrlExpiresAt.getOrNull())
+
+ /**
+ * Sets [Builder.downloadUrlExpiresAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.downloadUrlExpiresAt] with a well-typed [OffsetDateTime]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun downloadUrlExpiresAt(downloadUrlExpiresAt: JsonField) = apply {
+ this.downloadUrlExpiresAt = downloadUrlExpiresAt
+ }
+
+ /** 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 }
+
+ /** Reason the document failed validation. Null unless `status` is `REJECTED` */
+ fun failureReason(failureReason: FailureReason?) =
+ failureReason(JsonField.ofNullable(failureReason))
+
+ /** Alias for calling [Builder.failureReason] with `failureReason.orElse(null)`. */
+ fun failureReason(failureReason: Optional) =
+ failureReason(failureReason.getOrNull())
+
+ /**
+ * Sets [Builder.failureReason] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.failureReason] with a well-typed [FailureReason] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun failureReason(failureReason: JsonField) = apply {
+ this.failureReason = failureReason
+ }
+
+ /** Name provided when the upload intent was created */
+ fun name(name: String) = name(JsonField.of(name))
+
+ /**
+ * Sets [Builder.name] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.name] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun name(name: JsonField) = apply { this.name = name }
+
+ /**
+ * Identifier of the document requirement this document satisfies. Null for supplemental
+ * documents not tied to a specific requirement
+ */
+ fun requirementId(requirementId: String?) =
+ requirementId(JsonField.ofNullable(requirementId))
+
+ /** Alias for calling [Builder.requirementId] with `requirementId.orElse(null)`. */
+ fun requirementId(requirementId: Optional) =
+ requirementId(requirementId.getOrNull())
+
+ /**
+ * Sets [Builder.requirementId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.requirementId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun requirementId(requirementId: JsonField) = apply {
+ this.requirementId = requirementId
+ }
+
+ /** Current validation status of the document */
+ fun status(status: Status) = status(JsonField.of(status))
+
+ /**
+ * Sets [Builder.status] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.status] with a well-typed [Status] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun status(status: JsonField) = apply { this.status = status }
+
+ /** When the document was last 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 }
+
+ /** Constraints that an uploaded file must satisfy. */
+ fun uploadConstraints(uploadConstraints: UploadConstraints2?) =
+ uploadConstraints(JsonField.ofNullable(uploadConstraints))
+
+ /** Alias for calling [Builder.uploadConstraints] with `uploadConstraints.orElse(null)`. */
+ fun uploadConstraints(uploadConstraints: Optional) =
+ uploadConstraints(uploadConstraints.getOrNull())
+
+ /**
+ * Sets [Builder.uploadConstraints] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.uploadConstraints] with a well-typed
+ * [UploadConstraints2] value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun uploadConstraints(uploadConstraints: JsonField) = apply {
+ this.uploadConstraints = uploadConstraints
+ }
+
+ /**
+ * Presigned URL for uploading the file via HTTP PUT. Null after the upload window expires
+ * or after the document has been validated
+ */
+ fun uploadUrl(uploadUrl: String?) = uploadUrl(JsonField.ofNullable(uploadUrl))
+
+ /** Alias for calling [Builder.uploadUrl] with `uploadUrl.orElse(null)`. */
+ fun uploadUrl(uploadUrl: Optional) = uploadUrl(uploadUrl.getOrNull())
+
+ /**
+ * Sets [Builder.uploadUrl] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.uploadUrl] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun uploadUrl(uploadUrl: JsonField) = apply { this.uploadUrl = uploadUrl }
+
+ /** When the upload URL expires */
+ fun uploadUrlExpiresAt(uploadUrlExpiresAt: OffsetDateTime?) =
+ uploadUrlExpiresAt(JsonField.ofNullable(uploadUrlExpiresAt))
+
+ /**
+ * Alias for calling [Builder.uploadUrlExpiresAt] with `uploadUrlExpiresAt.orElse(null)`.
+ */
+ fun uploadUrlExpiresAt(uploadUrlExpiresAt: Optional) =
+ uploadUrlExpiresAt(uploadUrlExpiresAt.getOrNull())
+
+ /**
+ * Sets [Builder.uploadUrlExpiresAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.uploadUrlExpiresAt] with a well-typed [OffsetDateTime]
+ * value instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun uploadUrlExpiresAt(uploadUrlExpiresAt: JsonField) = apply {
+ this.uploadUrlExpiresAt = uploadUrlExpiresAt
+ }
+
+ 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 [ClaimDocumentAcceptedWebhookEvent].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .token()
+ * .created()
+ * .downloadUrl()
+ * .downloadUrlExpiresAt()
+ * .eventType()
+ * .failureReason()
+ * .name()
+ * .requirementId()
+ * .status()
+ * .updated()
+ * .uploadConstraints()
+ * .uploadUrl()
+ * .uploadUrlExpiresAt()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): ClaimDocumentAcceptedWebhookEvent =
+ ClaimDocumentAcceptedWebhookEvent(
+ checkRequired("token", token),
+ checkRequired("created", created),
+ checkRequired("downloadUrl", downloadUrl),
+ checkRequired("downloadUrlExpiresAt", downloadUrlExpiresAt),
+ checkRequired("eventType", eventType),
+ checkRequired("failureReason", failureReason),
+ checkRequired("name", name),
+ checkRequired("requirementId", requirementId),
+ checkRequired("status", status),
+ checkRequired("updated", updated),
+ checkRequired("uploadConstraints", uploadConstraints),
+ checkRequired("uploadUrl", uploadUrl),
+ checkRequired("uploadUrlExpiresAt", uploadUrlExpiresAt),
+ 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(): ClaimDocumentAcceptedWebhookEvent = apply {
+ if (validated) {
+ return@apply
+ }
+
+ token()
+ created()
+ downloadUrl()
+ downloadUrlExpiresAt()
+ eventType().validate()
+ failureReason().ifPresent { it.validate() }
+ name()
+ requirementId()
+ status().validate()
+ updated()
+ uploadConstraints().ifPresent { it.validate() }
+ uploadUrl()
+ uploadUrlExpiresAt()
+ 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 (created.asKnown().isPresent) 1 else 0) +
+ (if (downloadUrl.asKnown().isPresent) 1 else 0) +
+ (if (downloadUrlExpiresAt.asKnown().isPresent) 1 else 0) +
+ (eventType.asKnown().getOrNull()?.validity() ?: 0) +
+ (failureReason.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (name.asKnown().isPresent) 1 else 0) +
+ (if (requirementId.asKnown().isPresent) 1 else 0) +
+ (status.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (updated.asKnown().isPresent) 1 else 0) +
+ (uploadConstraints.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (uploadUrl.asKnown().isPresent) 1 else 0) +
+ (if (uploadUrlExpiresAt.asKnown().isPresent) 1 else 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 CLAIM_DOCUMENT_ACCEPTED = of("claim_document.accepted")
+
+ @JvmStatic fun of(value: String) = EventType(JsonField.of(value))
+ }
+
+ /** An enum containing [EventType]'s known values. */
+ enum class Known {
+ CLAIM_DOCUMENT_ACCEPTED
+ }
+
+ /**
+ * 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 {
+ CLAIM_DOCUMENT_ACCEPTED,
+ /**
+ * 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) {
+ CLAIM_DOCUMENT_ACCEPTED -> Value.CLAIM_DOCUMENT_ACCEPTED
+ 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) {
+ CLAIM_DOCUMENT_ACCEPTED -> Known.CLAIM_DOCUMENT_ACCEPTED
+ 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()
+ }
+
+ /** Reason the document failed validation. Null unless `status` is `REJECTED` */
+ class FailureReason @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 INVALID_MIME_TYPE = of("INVALID_MIME_TYPE")
+
+ @JvmField val FILE_TOO_LARGE = of("FILE_TOO_LARGE")
+
+ @JvmField val FILE_EMPTY = of("FILE_EMPTY")
+
+ @JvmField val CORRUPT_FILE = of("CORRUPT_FILE")
+
+ @JvmField val OTHER = of("OTHER")
+
+ @JvmStatic fun of(value: String) = FailureReason(JsonField.of(value))
+ }
+
+ /** An enum containing [FailureReason]'s known values. */
+ enum class Known {
+ INVALID_MIME_TYPE,
+ FILE_TOO_LARGE,
+ FILE_EMPTY,
+ CORRUPT_FILE,
+ OTHER,
+ }
+
+ /**
+ * An enum containing [FailureReason]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [FailureReason] 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 {
+ INVALID_MIME_TYPE,
+ FILE_TOO_LARGE,
+ FILE_EMPTY,
+ CORRUPT_FILE,
+ OTHER,
+ /**
+ * An enum member indicating that [FailureReason] 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) {
+ INVALID_MIME_TYPE -> Value.INVALID_MIME_TYPE
+ FILE_TOO_LARGE -> Value.FILE_TOO_LARGE
+ FILE_EMPTY -> Value.FILE_EMPTY
+ CORRUPT_FILE -> Value.CORRUPT_FILE
+ OTHER -> Value.OTHER
+ 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) {
+ INVALID_MIME_TYPE -> Known.INVALID_MIME_TYPE
+ FILE_TOO_LARGE -> Known.FILE_TOO_LARGE
+ FILE_EMPTY -> Known.FILE_EMPTY
+ CORRUPT_FILE -> Known.CORRUPT_FILE
+ OTHER -> Known.OTHER
+ else -> throw LithicInvalidDataException("Unknown FailureReason: $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(): FailureReason = 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 FailureReason && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** Current validation status of the document */
+ class Status @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 VALIDATING = of("VALIDATING")
+
+ @JvmField val ACCEPTED = of("ACCEPTED")
+
+ @JvmField val REJECTED = of("REJECTED")
+
+ @JvmStatic fun of(value: String) = Status(JsonField.of(value))
+ }
+
+ /** An enum containing [Status]'s known values. */
+ enum class Known {
+ PENDING,
+ VALIDATING,
+ ACCEPTED,
+ REJECTED,
+ }
+
+ /**
+ * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Status] 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,
+ VALIDATING,
+ ACCEPTED,
+ REJECTED,
+ /** An enum member indicating that [Status] 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
+ VALIDATING -> Value.VALIDATING
+ ACCEPTED -> Value.ACCEPTED
+ REJECTED -> Value.REJECTED
+ 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
+ VALIDATING -> Known.VALIDATING
+ ACCEPTED -> Known.ACCEPTED
+ REJECTED -> Known.REJECTED
+ else -> throw LithicInvalidDataException("Unknown Status: $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(): Status = 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 Status && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** Constraints that an uploaded file must satisfy. */
+ class UploadConstraints2
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val acceptedMimeTypes: JsonField>,
+ private val maxSizeBytes: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("accepted_mime_types")
+ @ExcludeMissing
+ acceptedMimeTypes: JsonField> = JsonMissing.of(),
+ @JsonProperty("max_size_bytes")
+ @ExcludeMissing
+ maxSizeBytes: JsonField = JsonMissing.of(),
+ ) : this(acceptedMimeTypes, maxSizeBytes, mutableMapOf())
+
+ /**
+ * MIME types accepted for upload
+ *
+ * @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 acceptedMimeTypes(): List = acceptedMimeTypes.getRequired("accepted_mime_types")
+
+ /**
+ * Maximum file size in bytes. Null if there is no enforced size limit
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun maxSizeBytes(): Optional = maxSizeBytes.getOptional("max_size_bytes")
+
+ /**
+ * Returns the raw JSON value of [acceptedMimeTypes].
+ *
+ * Unlike [acceptedMimeTypes], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("accepted_mime_types")
+ @ExcludeMissing
+ fun _acceptedMimeTypes(): JsonField> = acceptedMimeTypes
+
+ /**
+ * Returns the raw JSON value of [maxSizeBytes].
+ *
+ * Unlike [maxSizeBytes], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("max_size_bytes")
+ @ExcludeMissing
+ fun _maxSizeBytes(): JsonField = maxSizeBytes
+
+ @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 [UploadConstraints2].
+ *
+ * The following fields are required:
+ * ```java
+ * .acceptedMimeTypes()
+ * .maxSizeBytes()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [UploadConstraints2]. */
+ class Builder internal constructor() {
+
+ private var acceptedMimeTypes: JsonField>? = null
+ private var maxSizeBytes: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(uploadConstraints2: UploadConstraints2) = apply {
+ acceptedMimeTypes = uploadConstraints2.acceptedMimeTypes.map { it.toMutableList() }
+ maxSizeBytes = uploadConstraints2.maxSizeBytes
+ additionalProperties = uploadConstraints2.additionalProperties.toMutableMap()
+ }
+
+ /** MIME types accepted for upload */
+ fun acceptedMimeTypes(acceptedMimeTypes: List) =
+ acceptedMimeTypes(JsonField.of(acceptedMimeTypes))
+
+ /**
+ * Sets [Builder.acceptedMimeTypes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.acceptedMimeTypes] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun acceptedMimeTypes(acceptedMimeTypes: JsonField>) = apply {
+ this.acceptedMimeTypes = acceptedMimeTypes.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [acceptedMimeTypes].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addAcceptedMimeType(acceptedMimeType: String) = apply {
+ acceptedMimeTypes =
+ (acceptedMimeTypes ?: JsonField.of(mutableListOf())).also {
+ checkKnown("acceptedMimeTypes", it).add(acceptedMimeType)
+ }
+ }
+
+ /** Maximum file size in bytes. Null if there is no enforced size limit */
+ fun maxSizeBytes(maxSizeBytes: Long?) = maxSizeBytes(JsonField.ofNullable(maxSizeBytes))
+
+ /**
+ * Alias for [Builder.maxSizeBytes].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun maxSizeBytes(maxSizeBytes: Long) = maxSizeBytes(maxSizeBytes as Long?)
+
+ /** Alias for calling [Builder.maxSizeBytes] with `maxSizeBytes.orElse(null)`. */
+ fun maxSizeBytes(maxSizeBytes: Optional) = maxSizeBytes(maxSizeBytes.getOrNull())
+
+ /**
+ * Sets [Builder.maxSizeBytes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.maxSizeBytes] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun maxSizeBytes(maxSizeBytes: JsonField) = apply {
+ this.maxSizeBytes = maxSizeBytes
+ }
+
+ 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 [UploadConstraints2].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .acceptedMimeTypes()
+ * .maxSizeBytes()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): UploadConstraints2 =
+ UploadConstraints2(
+ checkRequired("acceptedMimeTypes", acceptedMimeTypes).map { it.toImmutable() },
+ checkRequired("maxSizeBytes", maxSizeBytes),
+ 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(): UploadConstraints2 = apply {
+ if (validated) {
+ return@apply
+ }
+
+ acceptedMimeTypes()
+ maxSizeBytes()
+ 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 =
+ (acceptedMimeTypes.asKnown().getOrNull()?.size ?: 0) +
+ (if (maxSizeBytes.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is UploadConstraints2 &&
+ acceptedMimeTypes == other.acceptedMimeTypes &&
+ maxSizeBytes == other.maxSizeBytes &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(acceptedMimeTypes, maxSizeBytes, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "UploadConstraints2{acceptedMimeTypes=$acceptedMimeTypes, maxSizeBytes=$maxSizeBytes, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is ClaimDocumentAcceptedWebhookEvent &&
+ token == other.token &&
+ created == other.created &&
+ downloadUrl == other.downloadUrl &&
+ downloadUrlExpiresAt == other.downloadUrlExpiresAt &&
+ eventType == other.eventType &&
+ failureReason == other.failureReason &&
+ name == other.name &&
+ requirementId == other.requirementId &&
+ status == other.status &&
+ updated == other.updated &&
+ uploadConstraints == other.uploadConstraints &&
+ uploadUrl == other.uploadUrl &&
+ uploadUrlExpiresAt == other.uploadUrlExpiresAt &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ token,
+ created,
+ downloadUrl,
+ downloadUrlExpiresAt,
+ eventType,
+ failureReason,
+ name,
+ requirementId,
+ status,
+ updated,
+ uploadConstraints,
+ uploadUrl,
+ uploadUrlExpiresAt,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "ClaimDocumentAcceptedWebhookEvent{token=$token, created=$created, downloadUrl=$downloadUrl, downloadUrlExpiresAt=$downloadUrlExpiresAt, eventType=$eventType, failureReason=$failureReason, name=$name, requirementId=$requirementId, status=$status, updated=$updated, uploadConstraints=$uploadConstraints, uploadUrl=$uploadUrl, uploadUrlExpiresAt=$uploadUrlExpiresAt, additionalProperties=$additionalProperties}"
+}
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimDocumentRejectedWebhookEvent.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimDocumentRejectedWebhookEvent.kt
new file mode 100644
index 000000000..bd0f02ed5
--- /dev/null
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ClaimDocumentRejectedWebhookEvent.kt
@@ -0,0 +1,1442 @@
+// 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.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class ClaimDocumentRejectedWebhookEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val token: JsonField,
+ private val created: JsonField,
+ private val downloadUrl: JsonField,
+ private val downloadUrlExpiresAt: JsonField,
+ private val eventType: JsonField,
+ private val failureReason: JsonField,
+ private val name: JsonField,
+ private val requirementId: JsonField,
+ private val status: JsonField,
+ private val updated: JsonField,
+ private val uploadConstraints: JsonField,
+ private val uploadUrl: JsonField,
+ private val uploadUrlExpiresAt: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
+ @JsonProperty("created")
+ @ExcludeMissing
+ created: JsonField = JsonMissing.of(),
+ @JsonProperty("download_url")
+ @ExcludeMissing
+ downloadUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("download_url_expires_at")
+ @ExcludeMissing
+ downloadUrlExpiresAt: JsonField = JsonMissing.of(),
+ @JsonProperty("event_type")
+ @ExcludeMissing
+ eventType: JsonField = JsonMissing.of(),
+ @JsonProperty("failure_reason")
+ @ExcludeMissing
+ failureReason: JsonField = JsonMissing.of(),
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ @JsonProperty("requirement_id")
+ @ExcludeMissing
+ requirementId: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("updated")
+ @ExcludeMissing
+ updated: JsonField = JsonMissing.of(),
+ @JsonProperty("upload_constraints")
+ @ExcludeMissing
+ uploadConstraints: JsonField = JsonMissing.of(),
+ @JsonProperty("upload_url") @ExcludeMissing uploadUrl: JsonField = JsonMissing.of(),
+ @JsonProperty("upload_url_expires_at")
+ @ExcludeMissing
+ uploadUrlExpiresAt: JsonField = JsonMissing.of(),
+ ) : this(
+ token,
+ created,
+ downloadUrl,
+ downloadUrlExpiresAt,
+ eventType,
+ failureReason,
+ name,
+ requirementId,
+ status,
+ updated,
+ uploadConstraints,
+ uploadUrl,
+ uploadUrlExpiresAt,
+ mutableMapOf(),
+ )
+
+ /**
+ * Unique identifier for the document, in UUID format
+ *
+ * @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")
+
+ /**
+ * When the document 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")
+
+ /**
+ * Presigned URL for downloading the uploaded document. Available once the document is being
+ * validated or has been accepted (`VALIDATING` or `ACCEPTED`)
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun downloadUrl(): Optional = downloadUrl.getOptional("download_url")
+
+ /**
+ * When the download URL expires
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun downloadUrlExpiresAt(): Optional =
+ downloadUrlExpiresAt.getOptional("download_url_expires_at")
+
+ /**
+ * 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")
+
+ /**
+ * Reason the document failed validation. Null unless `status` is `REJECTED`
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun failureReason(): Optional = failureReason.getOptional("failure_reason")
+
+ /**
+ * Name provided when the upload intent 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 name(): String = name.getRequired("name")
+
+ /**
+ * Identifier of the document requirement this document satisfies. Null for supplemental
+ * documents not tied to a specific requirement
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun requirementId(): Optional = requirementId.getOptional("requirement_id")
+
+ /**
+ * Current validation status of the document
+ *
+ * @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 status(): Status = status.getRequired("status")
+
+ /**
+ * When the document was last 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")
+
+ /**
+ * Constraints that an uploaded file must satisfy.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun uploadConstraints(): Optional =
+ uploadConstraints.getOptional("upload_constraints")
+
+ /**
+ * Presigned URL for uploading the file via HTTP PUT. Null after the upload window expires or
+ * after the document has been validated
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun uploadUrl(): Optional = uploadUrl.getOptional("upload_url")
+
+ /**
+ * When the upload URL expires
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun uploadUrlExpiresAt(): Optional =
+ uploadUrlExpiresAt.getOptional("upload_url_expires_at")
+
+ /**
+ * 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