diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 6dc64191e..cb4cd84d3 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.346.0"
+ ".": "0.347.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index cffc17a5a..238098d13 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/increase%2Fincrease-2932a989d9e2cf36e16aaea23ed5e0e1788be21d56042097ea6ea02f6cd9dcfe.yml
-openapi_spec_hash: 24a293bc92d9ac62345ef24cca251af7
-config_hash: a143293c5450ae8f52acad08f3102575
+configured_endpoints: 220
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-9e8783129ea725992844a51e7d6f6a639cae93753228cef7262eccb2e4bae58d.yml
+openapi_spec_hash: f1a7326721f814625c7d5484956afded
+config_hash: 4489d6e123ed885f5cb74fe619668e4b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ebcd85e7..129577b90 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,20 @@
# Changelog
+## 0.347.0 (2025-10-06)
+
+Full Changelog: [v0.346.0...v0.347.0](https://github.com/Increase/increase-java/compare/v0.346.0...v0.347.0)
+
+### Features
+
+* **api:** api update ([1b2b27b](https://github.com/Increase/increase-java/commit/1b2b27b41fe9d1d2a00b1524e1ee6cc08809571a))
+* **api:** api update ([443e6d7](https://github.com/Increase/increase-java/commit/443e6d78698488c070a1346ff26655ff63f9ef9e))
+* **api:** api update ([7b3da9f](https://github.com/Increase/increase-java/commit/7b3da9f438112a023cb85f7b0296c4fb633c40bd))
+
+
+### Bug Fixes
+
+* **client:** handle some Dispute objects as empty rather than unknown ([ca24660](https://github.com/Increase/increase-java/commit/ca24660b0a5bf5c580d77e5a04be7498aaa0dd40))
+
## 0.346.0 (2025-10-01)
Full Changelog: [v0.345.0...v0.346.0](https://github.com/Increase/increase-java/compare/v0.345.0...v0.346.0)
diff --git a/README.md b/README.md
index 5f91573fd..4829dd052 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.346.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.346.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.347.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.347.0)
@@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe
-The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.346.0).
+The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.347.0).
@@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d
### Gradle
```kotlin
-implementation("com.increase.api:increase-java:0.346.0")
+implementation("com.increase.api:increase-java:0.347.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.346.0")
com.increase.api
increase-java
- 0.346.0
+ 0.347.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 410c6ea48..3e6cc96e1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.346.0" // x-release-please-version
+ version = "0.347.0" // x-release-please-version
}
subprojects {
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt
index 952133bfb..4de8c0ea2 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt
@@ -12,6 +12,7 @@ import com.increase.api.services.blocking.AchTransferService
import com.increase.api.services.blocking.BookkeepingAccountService
import com.increase.api.services.blocking.BookkeepingEntryService
import com.increase.api.services.blocking.BookkeepingEntrySetService
+import com.increase.api.services.blocking.CardDisputeService
import com.increase.api.services.blocking.CardPaymentService
import com.increase.api.services.blocking.CardPurchaseSupplementService
import com.increase.api.services.blocking.CardPushTransferService
@@ -108,6 +109,8 @@ interface IncreaseClient {
fun cardPurchaseSupplements(): CardPurchaseSupplementService
+ fun cardDisputes(): CardDisputeService
+
fun physicalCards(): PhysicalCardService
fun digitalCardProfiles(): DigitalCardProfileService
@@ -241,6 +244,8 @@ interface IncreaseClient {
fun cardPurchaseSupplements(): CardPurchaseSupplementService.WithRawResponse
+ fun cardDisputes(): CardDisputeService.WithRawResponse
+
fun physicalCards(): PhysicalCardService.WithRawResponse
fun digitalCardProfiles(): DigitalCardProfileService.WithRawResponse
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt
index 254077478..ac800b994 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt
@@ -12,6 +12,7 @@ import com.increase.api.services.async.AchTransferServiceAsync
import com.increase.api.services.async.BookkeepingAccountServiceAsync
import com.increase.api.services.async.BookkeepingEntryServiceAsync
import com.increase.api.services.async.BookkeepingEntrySetServiceAsync
+import com.increase.api.services.async.CardDisputeServiceAsync
import com.increase.api.services.async.CardPaymentServiceAsync
import com.increase.api.services.async.CardPurchaseSupplementServiceAsync
import com.increase.api.services.async.CardPushTransferServiceAsync
@@ -108,6 +109,8 @@ interface IncreaseClientAsync {
fun cardPurchaseSupplements(): CardPurchaseSupplementServiceAsync
+ fun cardDisputes(): CardDisputeServiceAsync
+
fun physicalCards(): PhysicalCardServiceAsync
fun digitalCardProfiles(): DigitalCardProfileServiceAsync
@@ -245,6 +248,8 @@ interface IncreaseClientAsync {
fun cardPurchaseSupplements(): CardPurchaseSupplementServiceAsync.WithRawResponse
+ fun cardDisputes(): CardDisputeServiceAsync.WithRawResponse
+
fun physicalCards(): PhysicalCardServiceAsync.WithRawResponse
fun digitalCardProfiles(): DigitalCardProfileServiceAsync.WithRawResponse
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt
index 7c881b56d..1adb82f42 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt
@@ -22,6 +22,8 @@ import com.increase.api.services.async.BookkeepingEntryServiceAsync
import com.increase.api.services.async.BookkeepingEntryServiceAsyncImpl
import com.increase.api.services.async.BookkeepingEntrySetServiceAsync
import com.increase.api.services.async.BookkeepingEntrySetServiceAsyncImpl
+import com.increase.api.services.async.CardDisputeServiceAsync
+import com.increase.api.services.async.CardDisputeServiceAsyncImpl
import com.increase.api.services.async.CardPaymentServiceAsync
import com.increase.api.services.async.CardPaymentServiceAsyncImpl
import com.increase.api.services.async.CardPurchaseSupplementServiceAsync
@@ -155,6 +157,10 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
CardPurchaseSupplementServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val cardDisputes: CardDisputeServiceAsync by lazy {
+ CardDisputeServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
private val physicalCards: PhysicalCardServiceAsync by lazy {
PhysicalCardServiceAsyncImpl(clientOptionsWithUserAgent)
}
@@ -368,6 +374,8 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun cardPurchaseSupplements(): CardPurchaseSupplementServiceAsync =
cardPurchaseSupplements
+ override fun cardDisputes(): CardDisputeServiceAsync = cardDisputes
+
override fun physicalCards(): PhysicalCardServiceAsync = physicalCards
override fun digitalCardProfiles(): DigitalCardProfileServiceAsync = digitalCardProfiles
@@ -500,6 +508,10 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
CardPurchaseSupplementServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val cardDisputes: CardDisputeServiceAsync.WithRawResponse by lazy {
+ CardDisputeServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val physicalCards: PhysicalCardServiceAsync.WithRawResponse by lazy {
PhysicalCardServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
@@ -718,6 +730,8 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa
override fun cardPurchaseSupplements(): CardPurchaseSupplementServiceAsync.WithRawResponse =
cardPurchaseSupplements
+ override fun cardDisputes(): CardDisputeServiceAsync.WithRawResponse = cardDisputes
+
override fun physicalCards(): PhysicalCardServiceAsync.WithRawResponse = physicalCards
override fun digitalCardProfiles(): DigitalCardProfileServiceAsync.WithRawResponse =
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt
index b2c6d0aa0..0f57c4411 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt
@@ -22,6 +22,8 @@ import com.increase.api.services.blocking.BookkeepingEntryService
import com.increase.api.services.blocking.BookkeepingEntryServiceImpl
import com.increase.api.services.blocking.BookkeepingEntrySetService
import com.increase.api.services.blocking.BookkeepingEntrySetServiceImpl
+import com.increase.api.services.blocking.CardDisputeService
+import com.increase.api.services.blocking.CardDisputeServiceImpl
import com.increase.api.services.blocking.CardPaymentService
import com.increase.api.services.blocking.CardPaymentServiceImpl
import com.increase.api.services.blocking.CardPurchaseSupplementService
@@ -153,6 +155,10 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
CardPurchaseSupplementServiceImpl(clientOptionsWithUserAgent)
}
+ private val cardDisputes: CardDisputeService by lazy {
+ CardDisputeServiceImpl(clientOptionsWithUserAgent)
+ }
+
private val physicalCards: PhysicalCardService by lazy {
PhysicalCardServiceImpl(clientOptionsWithUserAgent)
}
@@ -352,6 +358,8 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun cardPurchaseSupplements(): CardPurchaseSupplementService = cardPurchaseSupplements
+ override fun cardDisputes(): CardDisputeService = cardDisputes
+
override fun physicalCards(): PhysicalCardService = physicalCards
override fun digitalCardProfiles(): DigitalCardProfileService = digitalCardProfiles
@@ -483,6 +491,10 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
CardPurchaseSupplementServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val cardDisputes: CardDisputeService.WithRawResponse by lazy {
+ CardDisputeServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
private val physicalCards: PhysicalCardService.WithRawResponse by lazy {
PhysicalCardServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -699,6 +711,8 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli
override fun cardPurchaseSupplements(): CardPurchaseSupplementService.WithRawResponse =
cardPurchaseSupplements
+ override fun cardDisputes(): CardDisputeService.WithRawResponse = cardDisputes
+
override fun physicalCards(): PhysicalCardService.WithRawResponse = physicalCards
override fun digitalCardProfiles(): DigitalCardProfileService.WithRawResponse =
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt
new file mode 100644
index 000000000..d8633d825
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt
@@ -0,0 +1,38261 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.carddisputes
+
+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.increase.api.core.Enum
+import com.increase.api.core.ExcludeMissing
+import com.increase.api.core.JsonField
+import com.increase.api.core.JsonMissing
+import com.increase.api.core.JsonValue
+import com.increase.api.core.checkKnown
+import com.increase.api.core.checkRequired
+import com.increase.api.core.toImmutable
+import com.increase.api.errors.IncreaseInvalidDataException
+import java.time.LocalDate
+import java.time.OffsetDateTime
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * If unauthorized activity occurs on a card, you can create a Card Dispute and we'll work with the
+ * card networks to return the funds if appropriate.
+ */
+class CardDispute
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val id: JsonField,
+ private val amount: JsonField,
+ private val cardId: JsonField,
+ private val createdAt: JsonField,
+ private val disputedTransactionId: JsonField,
+ private val idempotencyKey: JsonField,
+ private val loss: JsonField,
+ private val network: JsonField,
+ private val status: JsonField,
+ private val type: JsonField,
+ private val userSubmissionRequiredBy: JsonField,
+ private val visa: JsonField,
+ private val win: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
+ @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
+ @JsonProperty("card_id") @ExcludeMissing cardId: JsonField = JsonMissing.of(),
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ createdAt: JsonField = JsonMissing.of(),
+ @JsonProperty("disputed_transaction_id")
+ @ExcludeMissing
+ disputedTransactionId: JsonField = JsonMissing.of(),
+ @JsonProperty("idempotency_key")
+ @ExcludeMissing
+ idempotencyKey: JsonField = JsonMissing.of(),
+ @JsonProperty("loss") @ExcludeMissing loss: JsonField = JsonMissing.of(),
+ @JsonProperty("network") @ExcludeMissing network: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ @JsonProperty("user_submission_required_by")
+ @ExcludeMissing
+ userSubmissionRequiredBy: JsonField = JsonMissing.of(),
+ @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(),
+ @JsonProperty("win") @ExcludeMissing win: JsonField = JsonMissing.of(),
+ ) : this(
+ id,
+ amount,
+ cardId,
+ createdAt,
+ disputedTransactionId,
+ idempotencyKey,
+ loss,
+ network,
+ status,
+ type,
+ userSubmissionRequiredBy,
+ visa,
+ win,
+ mutableMapOf(),
+ )
+
+ /**
+ * The Card Dispute identifier.
+ *
+ * @throws IncreaseInvalidDataException 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 id(): String = id.getRequired("id")
+
+ /**
+ * The amount of the dispute.
+ *
+ * @throws IncreaseInvalidDataException 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 amount(): Long = amount.getRequired("amount")
+
+ /**
+ * The Card that the Card Dispute is associated with.
+ *
+ * @throws IncreaseInvalidDataException 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 cardId(): String = cardId.getRequired("card_id")
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Card
+ * Dispute was created.
+ *
+ * @throws IncreaseInvalidDataException 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 createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
+
+ /**
+ * The identifier of the Transaction that was disputed.
+ *
+ * @throws IncreaseInvalidDataException 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 disputedTransactionId(): String =
+ disputedTransactionId.getRequired("disputed_transaction_id")
+
+ /**
+ * The idempotency key you chose for this object. This value is unique across Increase and is
+ * used to ensure that a request is only processed once. Learn more about
+ * [idempotency](https://increase.com/documentation/idempotency-keys).
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun idempotencyKey(): Optional = idempotencyKey.getOptional("idempotency_key")
+
+ /**
+ * If the Card Dispute's status is `lost`, this will contain details of the lost dispute.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun loss(): Optional = loss.getOptional("loss")
+
+ /**
+ * The network that the Card Dispute is associated with.
+ *
+ * @throws IncreaseInvalidDataException 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 network(): Network = network.getRequired("network")
+
+ /**
+ * The status of the Card Dispute.
+ *
+ * @throws IncreaseInvalidDataException 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")
+
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `card_dispute`.
+ *
+ * @throws IncreaseInvalidDataException 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 type(): Type = type.getRequired("type")
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the user
+ * submission is required by. Present only if status is `user_submission_required` and a user
+ * submission is required by a certain time. Otherwise, this will be `nil`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun userSubmissionRequiredBy(): Optional =
+ userSubmissionRequiredBy.getOptional("user_submission_required_by")
+
+ /**
+ * Card Dispute information for card payments processed over Visa's network. This field will be
+ * present in the JSON response if and only if `network` is equal to `visa`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun visa(): Optional = visa.getOptional("visa")
+
+ /**
+ * If the Card Dispute's status is `won`, this will contain details of the won dispute.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun win(): Optional = win.getOptional("win")
+
+ /**
+ * Returns the raw JSON value of [id].
+ *
+ * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
+
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
+
+ /**
+ * Returns the raw JSON value of [cardId].
+ *
+ * Unlike [cardId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("card_id") @ExcludeMissing fun _cardId(): JsonField = cardId
+
+ /**
+ * Returns the raw JSON value of [createdAt].
+ *
+ * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ fun _createdAt(): JsonField = createdAt
+
+ /**
+ * Returns the raw JSON value of [disputedTransactionId].
+ *
+ * Unlike [disputedTransactionId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("disputed_transaction_id")
+ @ExcludeMissing
+ fun _disputedTransactionId(): JsonField = disputedTransactionId
+
+ /**
+ * Returns the raw JSON value of [idempotencyKey].
+ *
+ * Unlike [idempotencyKey], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("idempotency_key")
+ @ExcludeMissing
+ fun _idempotencyKey(): JsonField = idempotencyKey
+
+ /**
+ * Returns the raw JSON value of [loss].
+ *
+ * Unlike [loss], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("loss") @ExcludeMissing fun _loss(): JsonField = loss
+
+ /**
+ * Returns the raw JSON value of [network].
+ *
+ * Unlike [network], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("network") @ExcludeMissing fun _network(): JsonField = network
+
+ /**
+ * 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 [type].
+ *
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+
+ /**
+ * Returns the raw JSON value of [userSubmissionRequiredBy].
+ *
+ * Unlike [userSubmissionRequiredBy], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("user_submission_required_by")
+ @ExcludeMissing
+ fun _userSubmissionRequiredBy(): JsonField = userSubmissionRequiredBy
+
+ /**
+ * Returns the raw JSON value of [visa].
+ *
+ * Unlike [visa], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("visa") @ExcludeMissing fun _visa(): JsonField = visa
+
+ /**
+ * Returns the raw JSON value of [win].
+ *
+ * Unlike [win], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("win") @ExcludeMissing fun _win(): JsonField = win
+
+ @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 [CardDispute].
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .amount()
+ * .cardId()
+ * .createdAt()
+ * .disputedTransactionId()
+ * .idempotencyKey()
+ * .loss()
+ * .network()
+ * .status()
+ * .type()
+ * .userSubmissionRequiredBy()
+ * .visa()
+ * .win()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CardDispute]. */
+ class Builder internal constructor() {
+
+ private var id: JsonField? = null
+ private var amount: JsonField? = null
+ private var cardId: JsonField? = null
+ private var createdAt: JsonField? = null
+ private var disputedTransactionId: JsonField? = null
+ private var idempotencyKey: JsonField? = null
+ private var loss: JsonField? = null
+ private var network: JsonField? = null
+ private var status: JsonField? = null
+ private var type: JsonField? = null
+ private var userSubmissionRequiredBy: JsonField? = null
+ private var visa: JsonField? = null
+ private var win: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(cardDispute: CardDispute) = apply {
+ id = cardDispute.id
+ amount = cardDispute.amount
+ cardId = cardDispute.cardId
+ createdAt = cardDispute.createdAt
+ disputedTransactionId = cardDispute.disputedTransactionId
+ idempotencyKey = cardDispute.idempotencyKey
+ loss = cardDispute.loss
+ network = cardDispute.network
+ status = cardDispute.status
+ type = cardDispute.type
+ userSubmissionRequiredBy = cardDispute.userSubmissionRequiredBy
+ visa = cardDispute.visa
+ win = cardDispute.win
+ additionalProperties = cardDispute.additionalProperties.toMutableMap()
+ }
+
+ /** The Card Dispute identifier. */
+ fun id(id: String) = id(JsonField.of(id))
+
+ /**
+ * Sets [Builder.id] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.id] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun id(id: JsonField) = apply { this.id = id }
+
+ /** The amount of the dispute. */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun amount(amount: JsonField) = apply { this.amount = amount }
+
+ /** The Card that the Card Dispute is associated with. */
+ fun cardId(cardId: String) = cardId(JsonField.of(cardId))
+
+ /**
+ * Sets [Builder.cardId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cardId] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun cardId(cardId: JsonField) = apply { this.cardId = cardId }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Card
+ * Dispute was created.
+ */
+ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
+
+ /**
+ * Sets [Builder.createdAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+
+ /** The identifier of the Transaction that was disputed. */
+ fun disputedTransactionId(disputedTransactionId: String) =
+ disputedTransactionId(JsonField.of(disputedTransactionId))
+
+ /**
+ * Sets [Builder.disputedTransactionId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.disputedTransactionId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun disputedTransactionId(disputedTransactionId: JsonField) = apply {
+ this.disputedTransactionId = disputedTransactionId
+ }
+
+ /**
+ * The idempotency key you chose for this object. This value is unique across Increase and
+ * is used to ensure that a request is only processed once. Learn more about
+ * [idempotency](https://increase.com/documentation/idempotency-keys).
+ */
+ fun idempotencyKey(idempotencyKey: String?) =
+ idempotencyKey(JsonField.ofNullable(idempotencyKey))
+
+ /** Alias for calling [Builder.idempotencyKey] with `idempotencyKey.orElse(null)`. */
+ fun idempotencyKey(idempotencyKey: Optional) =
+ idempotencyKey(idempotencyKey.getOrNull())
+
+ /**
+ * Sets [Builder.idempotencyKey] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.idempotencyKey] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun idempotencyKey(idempotencyKey: JsonField) = apply {
+ this.idempotencyKey = idempotencyKey
+ }
+
+ /**
+ * If the Card Dispute's status is `lost`, this will contain details of the lost dispute.
+ */
+ fun loss(loss: Loss?) = loss(JsonField.ofNullable(loss))
+
+ /** Alias for calling [Builder.loss] with `loss.orElse(null)`. */
+ fun loss(loss: Optional) = loss(loss.getOrNull())
+
+ /**
+ * Sets [Builder.loss] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.loss] with a well-typed [Loss] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun loss(loss: JsonField) = apply { this.loss = loss }
+
+ /** The network that the Card Dispute is associated with. */
+ fun network(network: Network) = network(JsonField.of(network))
+
+ /**
+ * Sets [Builder.network] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.network] with a well-typed [Network] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun network(network: JsonField) = apply { this.network = network }
+
+ /** The status of the Card Dispute. */
+ 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 }
+
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `card_dispute`.
+ */
+ fun type(type: Type) = type(JsonField.of(type))
+
+ /**
+ * Sets [Builder.type] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.type] with a well-typed [Type] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun type(type: JsonField) = apply { this.type = type }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the user
+ * submission is required by. Present only if status is `user_submission_required` and a
+ * user submission is required by a certain time. Otherwise, this will be `nil`.
+ */
+ fun userSubmissionRequiredBy(userSubmissionRequiredBy: OffsetDateTime?) =
+ userSubmissionRequiredBy(JsonField.ofNullable(userSubmissionRequiredBy))
+
+ /**
+ * Alias for calling [Builder.userSubmissionRequiredBy] with
+ * `userSubmissionRequiredBy.orElse(null)`.
+ */
+ fun userSubmissionRequiredBy(userSubmissionRequiredBy: Optional) =
+ userSubmissionRequiredBy(userSubmissionRequiredBy.getOrNull())
+
+ /**
+ * Sets [Builder.userSubmissionRequiredBy] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.userSubmissionRequiredBy] with a well-typed
+ * [OffsetDateTime] value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun userSubmissionRequiredBy(userSubmissionRequiredBy: JsonField) = apply {
+ this.userSubmissionRequiredBy = userSubmissionRequiredBy
+ }
+
+ /**
+ * Card Dispute information for card payments processed over Visa's network. This field will
+ * be present in the JSON response if and only if `network` is equal to `visa`.
+ */
+ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa))
+
+ /** Alias for calling [Builder.visa] with `visa.orElse(null)`. */
+ fun visa(visa: Optional) = visa(visa.getOrNull())
+
+ /**
+ * Sets [Builder.visa] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.visa] with a well-typed [Visa] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun visa(visa: JsonField) = apply { this.visa = visa }
+
+ /** If the Card Dispute's status is `won`, this will contain details of the won dispute. */
+ fun win(win: Win?) = win(JsonField.ofNullable(win))
+
+ /** Alias for calling [Builder.win] with `win.orElse(null)`. */
+ fun win(win: Optional) = win(win.getOrNull())
+
+ /**
+ * Sets [Builder.win] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.win] with a well-typed [Win] value instead. This method
+ * is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun win(win: JsonField) = apply { this.win = win }
+
+ 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 [CardDispute].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .amount()
+ * .cardId()
+ * .createdAt()
+ * .disputedTransactionId()
+ * .idempotencyKey()
+ * .loss()
+ * .network()
+ * .status()
+ * .type()
+ * .userSubmissionRequiredBy()
+ * .visa()
+ * .win()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): CardDispute =
+ CardDispute(
+ checkRequired("id", id),
+ checkRequired("amount", amount),
+ checkRequired("cardId", cardId),
+ checkRequired("createdAt", createdAt),
+ checkRequired("disputedTransactionId", disputedTransactionId),
+ checkRequired("idempotencyKey", idempotencyKey),
+ checkRequired("loss", loss),
+ checkRequired("network", network),
+ checkRequired("status", status),
+ checkRequired("type", type),
+ checkRequired("userSubmissionRequiredBy", userSubmissionRequiredBy),
+ checkRequired("visa", visa),
+ checkRequired("win", win),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): CardDispute = apply {
+ if (validated) {
+ return@apply
+ }
+
+ id()
+ amount()
+ cardId()
+ createdAt()
+ disputedTransactionId()
+ idempotencyKey()
+ loss().ifPresent { it.validate() }
+ network().validate()
+ status().validate()
+ type().validate()
+ userSubmissionRequiredBy()
+ visa().ifPresent { it.validate() }
+ win().ifPresent { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 (id.asKnown().isPresent) 1 else 0) +
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (cardId.asKnown().isPresent) 1 else 0) +
+ (if (createdAt.asKnown().isPresent) 1 else 0) +
+ (if (disputedTransactionId.asKnown().isPresent) 1 else 0) +
+ (if (idempotencyKey.asKnown().isPresent) 1 else 0) +
+ (loss.asKnown().getOrNull()?.validity() ?: 0) +
+ (network.asKnown().getOrNull()?.validity() ?: 0) +
+ (status.asKnown().getOrNull()?.validity() ?: 0) +
+ (type.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (userSubmissionRequiredBy.asKnown().isPresent) 1 else 0) +
+ (visa.asKnown().getOrNull()?.validity() ?: 0) +
+ (win.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** If the Card Dispute's status is `lost`, this will contain details of the lost dispute. */
+ class Loss
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val lostAt: JsonField,
+ private val reason: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("lost_at")
+ @ExcludeMissing
+ lostAt: JsonField = JsonMissing.of(),
+ @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(),
+ ) : this(lostAt, reason, mutableMapOf())
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Card
+ * Dispute was lost.
+ *
+ * @throws IncreaseInvalidDataException 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 lostAt(): OffsetDateTime = lostAt.getRequired("lost_at")
+
+ /**
+ * The reason the Card Dispute was lost.
+ *
+ * @throws IncreaseInvalidDataException 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")
+
+ /**
+ * Returns the raw JSON value of [lostAt].
+ *
+ * Unlike [lostAt], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("lost_at") @ExcludeMissing fun _lostAt(): JsonField = lostAt
+
+ /**
+ * 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
+
+ @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 [Loss].
+ *
+ * The following fields are required:
+ * ```java
+ * .lostAt()
+ * .reason()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Loss]. */
+ class Builder internal constructor() {
+
+ private var lostAt: JsonField? = null
+ private var reason: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(loss: Loss) = apply {
+ lostAt = loss.lostAt
+ reason = loss.reason
+ additionalProperties = loss.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * Card Dispute was lost.
+ */
+ fun lostAt(lostAt: OffsetDateTime) = lostAt(JsonField.of(lostAt))
+
+ /**
+ * Sets [Builder.lostAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.lostAt] with a well-typed [OffsetDateTime] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun lostAt(lostAt: JsonField) = apply { this.lostAt = lostAt }
+
+ /** The reason the Card Dispute was lost. */
+ 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 }
+
+ 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 [Loss].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .lostAt()
+ * .reason()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Loss =
+ Loss(
+ checkRequired("lostAt", lostAt),
+ checkRequired("reason", reason),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Loss = apply {
+ if (validated) {
+ return@apply
+ }
+
+ lostAt()
+ reason().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 (lostAt.asKnown().isPresent) 1 else 0) +
+ (reason.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** The reason the Card Dispute was lost. */
+ 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 {
+
+ /** The user withdrew the Card Dispute. */
+ @JvmField val USER_WITHDRAWN = of("user_withdrawn")
+
+ /** The Card Dispute was lost according to network rules. */
+ @JvmField val LOSS = of("loss")
+
+ @JvmStatic fun of(value: String) = Reason(JsonField.of(value))
+ }
+
+ /** An enum containing [Reason]'s known values. */
+ enum class Known {
+ /** The user withdrew the Card Dispute. */
+ USER_WITHDRAWN,
+ /** The Card Dispute was lost according to network rules. */
+ LOSS,
+ }
+
+ /**
+ * 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 {
+ /** The user withdrew the Card Dispute. */
+ USER_WITHDRAWN,
+ /** The Card Dispute was lost according to network rules. */
+ LOSS,
+ /**
+ * 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) {
+ USER_WITHDRAWN -> Value.USER_WITHDRAWN
+ LOSS -> Value.LOSS
+ 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 IncreaseInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ USER_WITHDRAWN -> Known.USER_WITHDRAWN
+ LOSS -> Known.LOSS
+ else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Reason = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Loss &&
+ lostAt == other.lostAt &&
+ reason == other.reason &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(lostAt, reason, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Loss{lostAt=$lostAt, reason=$reason, additionalProperties=$additionalProperties}"
+ }
+
+ /** The network that the Card Dispute is associated with. */
+ class Network @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 {
+
+ /** Visa: details will be under the `visa` object. */
+ @JvmField val VISA = of("visa")
+
+ @JvmStatic fun of(value: String) = Network(JsonField.of(value))
+ }
+
+ /** An enum containing [Network]'s known values. */
+ enum class Known {
+ /** Visa: details will be under the `visa` object. */
+ VISA
+ }
+
+ /**
+ * An enum containing [Network]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Network] 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 {
+ /** Visa: details will be under the `visa` object. */
+ VISA,
+ /** An enum member indicating that [Network] 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) {
+ VISA -> Value.VISA
+ 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 IncreaseInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ VISA -> Known.VISA
+ else -> throw IncreaseInvalidDataException("Unknown Network: $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 IncreaseInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Network = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 Network && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** The status of the Card Dispute. */
+ 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 {
+
+ /** A User Submission is required to continue with the Card Dispute. */
+ @JvmField val USER_SUBMISSION_REQUIRED = of("user_submission_required")
+
+ /** The most recent User Submission is being reviewed. */
+ @JvmField
+ val PENDING_USER_SUBMISSION_REVIEWING = of("pending_user_submission_reviewing")
+
+ /** The most recent User Submission is being submitted to the network. */
+ @JvmField
+ val PENDING_USER_SUBMISSION_SUBMITTING = of("pending_user_submission_submitting")
+
+ /** The user's withdrawal of the Card Dispute is being submitted to the network. */
+ @JvmField
+ val PENDING_USER_WITHDRAWAL_SUBMITTING = of("pending_user_withdrawal_submitting")
+
+ /** The Card Dispute is pending a response from the network. */
+ @JvmField val PENDING_RESPONSE = of("pending_response")
+
+ /**
+ * The Card Dispute has been lost and funds previously credited from the acceptance have
+ * been debited.
+ */
+ @JvmField val LOST = of("lost")
+
+ /** The Card Dispute has been won and no further action can be taken. */
+ @JvmField val WON = of("won")
+
+ @JvmStatic fun of(value: String) = Status(JsonField.of(value))
+ }
+
+ /** An enum containing [Status]'s known values. */
+ enum class Known {
+ /** A User Submission is required to continue with the Card Dispute. */
+ USER_SUBMISSION_REQUIRED,
+ /** The most recent User Submission is being reviewed. */
+ PENDING_USER_SUBMISSION_REVIEWING,
+ /** The most recent User Submission is being submitted to the network. */
+ PENDING_USER_SUBMISSION_SUBMITTING,
+ /** The user's withdrawal of the Card Dispute is being submitted to the network. */
+ PENDING_USER_WITHDRAWAL_SUBMITTING,
+ /** The Card Dispute is pending a response from the network. */
+ PENDING_RESPONSE,
+ /**
+ * The Card Dispute has been lost and funds previously credited from the acceptance have
+ * been debited.
+ */
+ LOST,
+ /** The Card Dispute has been won and no further action can be taken. */
+ WON,
+ }
+
+ /**
+ * 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 {
+ /** A User Submission is required to continue with the Card Dispute. */
+ USER_SUBMISSION_REQUIRED,
+ /** The most recent User Submission is being reviewed. */
+ PENDING_USER_SUBMISSION_REVIEWING,
+ /** The most recent User Submission is being submitted to the network. */
+ PENDING_USER_SUBMISSION_SUBMITTING,
+ /** The user's withdrawal of the Card Dispute is being submitted to the network. */
+ PENDING_USER_WITHDRAWAL_SUBMITTING,
+ /** The Card Dispute is pending a response from the network. */
+ PENDING_RESPONSE,
+ /**
+ * The Card Dispute has been lost and funds previously credited from the acceptance have
+ * been debited.
+ */
+ LOST,
+ /** The Card Dispute has been won and no further action can be taken. */
+ WON,
+ /** 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) {
+ USER_SUBMISSION_REQUIRED -> Value.USER_SUBMISSION_REQUIRED
+ PENDING_USER_SUBMISSION_REVIEWING -> Value.PENDING_USER_SUBMISSION_REVIEWING
+ PENDING_USER_SUBMISSION_SUBMITTING -> Value.PENDING_USER_SUBMISSION_SUBMITTING
+ PENDING_USER_WITHDRAWAL_SUBMITTING -> Value.PENDING_USER_WITHDRAWAL_SUBMITTING
+ PENDING_RESPONSE -> Value.PENDING_RESPONSE
+ LOST -> Value.LOST
+ WON -> Value.WON
+ 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 IncreaseInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ USER_SUBMISSION_REQUIRED -> Known.USER_SUBMISSION_REQUIRED
+ PENDING_USER_SUBMISSION_REVIEWING -> Known.PENDING_USER_SUBMISSION_REVIEWING
+ PENDING_USER_SUBMISSION_SUBMITTING -> Known.PENDING_USER_SUBMISSION_SUBMITTING
+ PENDING_USER_WITHDRAWAL_SUBMITTING -> Known.PENDING_USER_WITHDRAWAL_SUBMITTING
+ PENDING_RESPONSE -> Known.PENDING_RESPONSE
+ LOST -> Known.LOST
+ WON -> Known.WON
+ else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Status = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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()
+ }
+
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `card_dispute`.
+ */
+ class Type @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_DISPUTE = of("card_dispute")
+
+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
+ }
+
+ /** An enum containing [Type]'s known values. */
+ enum class Known {
+ CARD_DISPUTE
+ }
+
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] 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_DISPUTE,
+ /** An enum member indicating that [Type] 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_DISPUTE -> Value.CARD_DISPUTE
+ 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 IncreaseInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ CARD_DISPUTE -> Known.CARD_DISPUTE
+ else -> throw IncreaseInvalidDataException("Unknown Type: $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 IncreaseInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Type = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 Type && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /**
+ * Card Dispute information for card payments processed over Visa's network. This field will be
+ * present in the JSON response if and only if `network` is equal to `visa`.
+ */
+ class Visa
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val networkEvents: JsonField>,
+ private val requiredUserSubmissionCategory: JsonField,
+ private val userSubmissions: JsonField>,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("network_events")
+ @ExcludeMissing
+ networkEvents: JsonField> = JsonMissing.of(),
+ @JsonProperty("required_user_submission_category")
+ @ExcludeMissing
+ requiredUserSubmissionCategory: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("user_submissions")
+ @ExcludeMissing
+ userSubmissions: JsonField> = JsonMissing.of(),
+ ) : this(networkEvents, requiredUserSubmissionCategory, userSubmissions, mutableMapOf())
+
+ /**
+ * The network events for the Card Dispute.
+ *
+ * @throws IncreaseInvalidDataException 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 networkEvents(): List = networkEvents.getRequired("network_events")
+
+ /**
+ * The category of the currently required user submission if the user wishes to proceed with
+ * the dispute. Present if and only if status is `user_submission_required`. Otherwise, this
+ * will be `nil`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun requiredUserSubmissionCategory(): Optional =
+ requiredUserSubmissionCategory.getOptional("required_user_submission_category")
+
+ /**
+ * The user submissions for the Card Dispute.
+ *
+ * @throws IncreaseInvalidDataException 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 userSubmissions(): List =
+ userSubmissions.getRequired("user_submissions")
+
+ /**
+ * Returns the raw JSON value of [networkEvents].
+ *
+ * Unlike [networkEvents], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("network_events")
+ @ExcludeMissing
+ fun _networkEvents(): JsonField> = networkEvents
+
+ /**
+ * Returns the raw JSON value of [requiredUserSubmissionCategory].
+ *
+ * Unlike [requiredUserSubmissionCategory], this method doesn't throw if the JSON field has
+ * an unexpected type.
+ */
+ @JsonProperty("required_user_submission_category")
+ @ExcludeMissing
+ fun _requiredUserSubmissionCategory(): JsonField =
+ requiredUserSubmissionCategory
+
+ /**
+ * Returns the raw JSON value of [userSubmissions].
+ *
+ * Unlike [userSubmissions], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("user_submissions")
+ @ExcludeMissing
+ fun _userSubmissions(): JsonField> = userSubmissions
+
+ @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 [Visa].
+ *
+ * The following fields are required:
+ * ```java
+ * .networkEvents()
+ * .requiredUserSubmissionCategory()
+ * .userSubmissions()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Visa]. */
+ class Builder internal constructor() {
+
+ private var networkEvents: JsonField>? = null
+ private var requiredUserSubmissionCategory: JsonField? =
+ null
+ private var userSubmissions: JsonField>? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(visa: Visa) = apply {
+ networkEvents = visa.networkEvents.map { it.toMutableList() }
+ requiredUserSubmissionCategory = visa.requiredUserSubmissionCategory
+ userSubmissions = visa.userSubmissions.map { it.toMutableList() }
+ additionalProperties = visa.additionalProperties.toMutableMap()
+ }
+
+ /** The network events for the Card Dispute. */
+ fun networkEvents(networkEvents: List) =
+ networkEvents(JsonField.of(networkEvents))
+
+ /**
+ * Sets [Builder.networkEvents] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.networkEvents] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun networkEvents(networkEvents: JsonField>) = apply {
+ this.networkEvents = networkEvents.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [NetworkEvent] to [networkEvents].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addNetworkEvent(networkEvent: NetworkEvent) = apply {
+ networkEvents =
+ (networkEvents ?: JsonField.of(mutableListOf())).also {
+ checkKnown("networkEvents", it).add(networkEvent)
+ }
+ }
+
+ /**
+ * The category of the currently required user submission if the user wishes to proceed
+ * with the dispute. Present if and only if status is `user_submission_required`.
+ * Otherwise, this will be `nil`.
+ */
+ fun requiredUserSubmissionCategory(
+ requiredUserSubmissionCategory: RequiredUserSubmissionCategory?
+ ) = requiredUserSubmissionCategory(JsonField.ofNullable(requiredUserSubmissionCategory))
+
+ /**
+ * Alias for calling [Builder.requiredUserSubmissionCategory] with
+ * `requiredUserSubmissionCategory.orElse(null)`.
+ */
+ fun requiredUserSubmissionCategory(
+ requiredUserSubmissionCategory: Optional
+ ) = requiredUserSubmissionCategory(requiredUserSubmissionCategory.getOrNull())
+
+ /**
+ * Sets [Builder.requiredUserSubmissionCategory] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.requiredUserSubmissionCategory] with a well-typed
+ * [RequiredUserSubmissionCategory] value instead. This method is primarily for setting
+ * the field to an undocumented or not yet supported value.
+ */
+ fun requiredUserSubmissionCategory(
+ requiredUserSubmissionCategory: JsonField
+ ) = apply { this.requiredUserSubmissionCategory = requiredUserSubmissionCategory }
+
+ /** The user submissions for the Card Dispute. */
+ fun userSubmissions(userSubmissions: List) =
+ userSubmissions(JsonField.of(userSubmissions))
+
+ /**
+ * Sets [Builder.userSubmissions] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.userSubmissions] with a well-typed
+ * `List` value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun userSubmissions(userSubmissions: JsonField>) = apply {
+ this.userSubmissions = userSubmissions.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [UserSubmission] to [userSubmissions].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addUserSubmission(userSubmission: UserSubmission) = apply {
+ userSubmissions =
+ (userSubmissions ?: JsonField.of(mutableListOf())).also {
+ checkKnown("userSubmissions", it).add(userSubmission)
+ }
+ }
+
+ 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 [Visa].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .networkEvents()
+ * .requiredUserSubmissionCategory()
+ * .userSubmissions()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Visa =
+ Visa(
+ checkRequired("networkEvents", networkEvents).map { it.toImmutable() },
+ checkRequired("requiredUserSubmissionCategory", requiredUserSubmissionCategory),
+ checkRequired("userSubmissions", userSubmissions).map { it.toImmutable() },
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Visa = apply {
+ if (validated) {
+ return@apply
+ }
+
+ networkEvents().forEach { it.validate() }
+ requiredUserSubmissionCategory().ifPresent { it.validate() }
+ userSubmissions().forEach { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 =
+ (networkEvents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (requiredUserSubmissionCategory.asKnown().getOrNull()?.validity() ?: 0) +
+ (userSubmissions.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+
+ class NetworkEvent
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val attachmentFiles: JsonField>,
+ private val category: JsonField,
+ private val chargebackAccepted: JsonValue,
+ private val chargebackSubmitted: JsonValue,
+ private val chargebackTimedOut: JsonValue,
+ private val createdAt: JsonField,
+ private val disputeFinancialTransactionId: JsonField,
+ private val merchantPrearbitrationDeclineSubmitted: JsonValue,
+ private val merchantPrearbitrationReceived: JsonField,
+ private val merchantPrearbitrationTimedOut: JsonValue,
+ private val represented: JsonField,
+ private val representmentTimedOut: JsonValue,
+ private val userPrearbitrationAccepted: JsonValue,
+ private val userPrearbitrationDeclined: JsonValue,
+ private val userPrearbitrationSubmitted: JsonValue,
+ private val userPrearbitrationTimedOut: JsonValue,
+ private val userWithdrawalSubmitted: JsonValue,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("attachment_files")
+ @ExcludeMissing
+ attachmentFiles: JsonField> = JsonMissing.of(),
+ @JsonProperty("category")
+ @ExcludeMissing
+ category: JsonField = JsonMissing.of(),
+ @JsonProperty("chargeback_accepted")
+ @ExcludeMissing
+ chargebackAccepted: JsonValue = JsonMissing.of(),
+ @JsonProperty("chargeback_submitted")
+ @ExcludeMissing
+ chargebackSubmitted: JsonValue = JsonMissing.of(),
+ @JsonProperty("chargeback_timed_out")
+ @ExcludeMissing
+ chargebackTimedOut: JsonValue = JsonMissing.of(),
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ createdAt: JsonField = JsonMissing.of(),
+ @JsonProperty("dispute_financial_transaction_id")
+ @ExcludeMissing
+ disputeFinancialTransactionId: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_prearbitration_decline_submitted")
+ @ExcludeMissing
+ merchantPrearbitrationDeclineSubmitted: JsonValue = JsonMissing.of(),
+ @JsonProperty("merchant_prearbitration_received")
+ @ExcludeMissing
+ merchantPrearbitrationReceived: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("merchant_prearbitration_timed_out")
+ @ExcludeMissing
+ merchantPrearbitrationTimedOut: JsonValue = JsonMissing.of(),
+ @JsonProperty("represented")
+ @ExcludeMissing
+ represented: JsonField = JsonMissing.of(),
+ @JsonProperty("representment_timed_out")
+ @ExcludeMissing
+ representmentTimedOut: JsonValue = JsonMissing.of(),
+ @JsonProperty("user_prearbitration_accepted")
+ @ExcludeMissing
+ userPrearbitrationAccepted: JsonValue = JsonMissing.of(),
+ @JsonProperty("user_prearbitration_declined")
+ @ExcludeMissing
+ userPrearbitrationDeclined: JsonValue = JsonMissing.of(),
+ @JsonProperty("user_prearbitration_submitted")
+ @ExcludeMissing
+ userPrearbitrationSubmitted: JsonValue = JsonMissing.of(),
+ @JsonProperty("user_prearbitration_timed_out")
+ @ExcludeMissing
+ userPrearbitrationTimedOut: JsonValue = JsonMissing.of(),
+ @JsonProperty("user_withdrawal_submitted")
+ @ExcludeMissing
+ userWithdrawalSubmitted: JsonValue = JsonMissing.of(),
+ ) : this(
+ attachmentFiles,
+ category,
+ chargebackAccepted,
+ chargebackSubmitted,
+ chargebackTimedOut,
+ createdAt,
+ disputeFinancialTransactionId,
+ merchantPrearbitrationDeclineSubmitted,
+ merchantPrearbitrationReceived,
+ merchantPrearbitrationTimedOut,
+ represented,
+ representmentTimedOut,
+ userPrearbitrationAccepted,
+ userPrearbitrationDeclined,
+ userPrearbitrationSubmitted,
+ userPrearbitrationTimedOut,
+ userWithdrawalSubmitted,
+ mutableMapOf(),
+ )
+
+ /**
+ * The files attached to the Visa Card Dispute User Submission.
+ *
+ * @throws IncreaseInvalidDataException 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 attachmentFiles(): List =
+ attachmentFiles.getRequired("attachment_files")
+
+ /**
+ * The category of the user submission. We may add additional possible values for this
+ * enum over time; your application should be able to handle such additions gracefully.
+ *
+ * @throws IncreaseInvalidDataException 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 category(): Category = category.getRequired("category")
+
+ /**
+ * A Card Dispute Chargeback Accepted Visa Network Event object. This field will be
+ * present in the JSON response if and only if `category` is equal to
+ * `chargeback_accepted`. Contains the details specific to a chargeback accepted Visa
+ * Card Dispute Network Event, which represents that a chargeback has been accepted by
+ * the merchant.
+ */
+ @JsonProperty("chargeback_accepted")
+ @ExcludeMissing
+ fun _chargebackAccepted(): JsonValue = chargebackAccepted
+
+ /**
+ * A Card Dispute Chargeback Submitted Visa Network Event object. This field will be
+ * present in the JSON response if and only if `category` is equal to
+ * `chargeback_submitted`. Contains the details specific to a chargeback submitted Visa
+ * Card Dispute Network Event, which represents that a chargeback has been submitted to
+ * the network.
+ */
+ @JsonProperty("chargeback_submitted")
+ @ExcludeMissing
+ fun _chargebackSubmitted(): JsonValue = chargebackSubmitted
+
+ /**
+ * A Card Dispute Chargeback Timed Out Visa Network Event object. This field will be
+ * present in the JSON response if and only if `category` is equal to
+ * `chargeback_timed_out`. Contains the details specific to a chargeback timed out Visa
+ * Card Dispute Network Event, which represents that the chargeback has timed out in the
+ * user's favor.
+ */
+ @JsonProperty("chargeback_timed_out")
+ @ExcludeMissing
+ fun _chargebackTimedOut(): JsonValue = chargebackTimedOut
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * Visa Card Dispute Network Event was created.
+ *
+ * @throws IncreaseInvalidDataException 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 createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
+
+ /**
+ * The dispute financial transaction that resulted from the network event, if any.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun disputeFinancialTransactionId(): Optional =
+ disputeFinancialTransactionId.getOptional("dispute_financial_transaction_id")
+
+ /**
+ * A Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event object.
+ * This field will be present in the JSON response if and only if `category` is equal to
+ * `merchant_prearbitration_decline_submitted`. Contains the details specific to a
+ * merchant prearbitration decline submitted Visa Card Dispute Network Event, which
+ * represents that the user has declined the merchant's request for a prearbitration
+ * request decision in their favor.
+ */
+ @JsonProperty("merchant_prearbitration_decline_submitted")
+ @ExcludeMissing
+ fun _merchantPrearbitrationDeclineSubmitted(): JsonValue =
+ merchantPrearbitrationDeclineSubmitted
+
+ /**
+ * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `merchant_prearbitration_received`. Contains the details specific to a merchant
+ * prearbitration received Visa Card Dispute Network Event, which represents that the
+ * merchant has issued a prearbitration request in the user's favor.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun merchantPrearbitrationReceived(): Optional =
+ merchantPrearbitrationReceived.getOptional("merchant_prearbitration_received")
+
+ /**
+ * A Card Dispute Merchant Pre-Arbitration Timed Out Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `merchant_prearbitration_timed_out`. Contains the details specific to a merchant
+ * prearbitration timed out Visa Card Dispute Network Event, which represents that the
+ * user has timed out responding to the merchant's prearbitration request.
+ */
+ @JsonProperty("merchant_prearbitration_timed_out")
+ @ExcludeMissing
+ fun _merchantPrearbitrationTimedOut(): JsonValue = merchantPrearbitrationTimedOut
+
+ /**
+ * A Card Dispute Re-presented Visa Network Event object. This field will be present in
+ * the JSON response if and only if `category` is equal to `represented`. Contains the
+ * details specific to a re-presented Visa Card Dispute Network Event, which represents
+ * that the merchant has declined the user's chargeback and has re-presented the
+ * payment.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun represented(): Optional = represented.getOptional("represented")
+
+ /**
+ * A Card Dispute Re-presentment Timed Out Visa Network Event object. This field will be
+ * present in the JSON response if and only if `category` is equal to
+ * `representment_timed_out`. Contains the details specific to a re-presentment time-out
+ * Visa Card Dispute Network Event, which represents that the user did not respond to
+ * the re-presentment by the merchant within the time limit.
+ */
+ @JsonProperty("representment_timed_out")
+ @ExcludeMissing
+ fun _representmentTimedOut(): JsonValue = representmentTimedOut
+
+ /**
+ * A Card Dispute User Pre-Arbitration Accepted Visa Network Event object. This field
+ * will be present in the JSON response if and only if `category` is equal to
+ * `user_prearbitration_accepted`. Contains the details specific to a user
+ * prearbitration accepted Visa Card Dispute Network Event, which represents that the
+ * merchant has accepted the user's prearbitration request in the user's favor.
+ */
+ @JsonProperty("user_prearbitration_accepted")
+ @ExcludeMissing
+ fun _userPrearbitrationAccepted(): JsonValue = userPrearbitrationAccepted
+
+ /**
+ * A Card Dispute User Pre-Arbitration Declined Visa Network Event object. This field
+ * will be present in the JSON response if and only if `category` is equal to
+ * `user_prearbitration_declined`. Contains the details specific to a user
+ * prearbitration declined Visa Card Dispute Network Event, which represents that the
+ * merchant has declined the user's prearbitration request.
+ */
+ @JsonProperty("user_prearbitration_declined")
+ @ExcludeMissing
+ fun _userPrearbitrationDeclined(): JsonValue = userPrearbitrationDeclined
+
+ /**
+ * A Card Dispute User Pre-Arbitration Submitted Visa Network Event object. This field
+ * will be present in the JSON response if and only if `category` is equal to
+ * `user_prearbitration_submitted`. Contains the details specific to a user
+ * prearbitration submitted Visa Card Dispute Network Event, which represents that the
+ * user's request for prearbitration has been submitted to the network.
+ */
+ @JsonProperty("user_prearbitration_submitted")
+ @ExcludeMissing
+ fun _userPrearbitrationSubmitted(): JsonValue = userPrearbitrationSubmitted
+
+ /**
+ * A Card Dispute User Pre-Arbitration Timed Out Visa Network Event object. This field
+ * will be present in the JSON response if and only if `category` is equal to
+ * `user_prearbitration_timed_out`. Contains the details specific to a user
+ * prearbitration timed out Visa Card Dispute Network Event, which represents that the
+ * merchant has timed out responding to the user's prearbitration request.
+ */
+ @JsonProperty("user_prearbitration_timed_out")
+ @ExcludeMissing
+ fun _userPrearbitrationTimedOut(): JsonValue = userPrearbitrationTimedOut
+
+ /**
+ * A Card Dispute User Withdrawal Submitted Visa Network Event object. This field will
+ * be present in the JSON response if and only if `category` is equal to
+ * `user_withdrawal_submitted`. Contains the details specific to a user withdrawal
+ * submitted Visa Card Dispute Network Event, which represents that the user's request
+ * to withdraw the dispute has been submitted to the network.
+ */
+ @JsonProperty("user_withdrawal_submitted")
+ @ExcludeMissing
+ fun _userWithdrawalSubmitted(): JsonValue = userWithdrawalSubmitted
+
+ /**
+ * Returns the raw JSON value of [attachmentFiles].
+ *
+ * Unlike [attachmentFiles], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("attachment_files")
+ @ExcludeMissing
+ fun _attachmentFiles(): JsonField> = attachmentFiles
+
+ /**
+ * Returns the raw JSON value of [category].
+ *
+ * Unlike [category], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("category")
+ @ExcludeMissing
+ fun _category(): JsonField = category
+
+ /**
+ * Returns the raw JSON value of [createdAt].
+ *
+ * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ fun _createdAt(): JsonField = createdAt
+
+ /**
+ * Returns the raw JSON value of [disputeFinancialTransactionId].
+ *
+ * Unlike [disputeFinancialTransactionId], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("dispute_financial_transaction_id")
+ @ExcludeMissing
+ fun _disputeFinancialTransactionId(): JsonField = disputeFinancialTransactionId
+
+ /**
+ * Returns the raw JSON value of [merchantPrearbitrationReceived].
+ *
+ * Unlike [merchantPrearbitrationReceived], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("merchant_prearbitration_received")
+ @ExcludeMissing
+ fun _merchantPrearbitrationReceived(): JsonField =
+ merchantPrearbitrationReceived
+
+ /**
+ * Returns the raw JSON value of [represented].
+ *
+ * Unlike [represented], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("represented")
+ @ExcludeMissing
+ fun _represented(): JsonField = represented
+
+ @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 [NetworkEvent].
+ *
+ * The following fields are required:
+ * ```java
+ * .attachmentFiles()
+ * .category()
+ * .chargebackAccepted()
+ * .chargebackSubmitted()
+ * .chargebackTimedOut()
+ * .createdAt()
+ * .disputeFinancialTransactionId()
+ * .merchantPrearbitrationDeclineSubmitted()
+ * .merchantPrearbitrationReceived()
+ * .merchantPrearbitrationTimedOut()
+ * .represented()
+ * .representmentTimedOut()
+ * .userPrearbitrationAccepted()
+ * .userPrearbitrationDeclined()
+ * .userPrearbitrationSubmitted()
+ * .userPrearbitrationTimedOut()
+ * .userWithdrawalSubmitted()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [NetworkEvent]. */
+ class Builder internal constructor() {
+
+ private var attachmentFiles: JsonField>? = null
+ private var category: JsonField? = null
+ private var chargebackAccepted: JsonValue? = null
+ private var chargebackSubmitted: JsonValue? = null
+ private var chargebackTimedOut: JsonValue? = null
+ private var createdAt: JsonField? = null
+ private var disputeFinancialTransactionId: JsonField? = null
+ private var merchantPrearbitrationDeclineSubmitted: JsonValue? = null
+ private var merchantPrearbitrationReceived:
+ JsonField? =
+ null
+ private var merchantPrearbitrationTimedOut: JsonValue? = null
+ private var represented: JsonField? = null
+ private var representmentTimedOut: JsonValue? = null
+ private var userPrearbitrationAccepted: JsonValue? = null
+ private var userPrearbitrationDeclined: JsonValue? = null
+ private var userPrearbitrationSubmitted: JsonValue? = null
+ private var userPrearbitrationTimedOut: JsonValue? = null
+ private var userWithdrawalSubmitted: JsonValue? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(networkEvent: NetworkEvent) = apply {
+ attachmentFiles = networkEvent.attachmentFiles.map { it.toMutableList() }
+ category = networkEvent.category
+ chargebackAccepted = networkEvent.chargebackAccepted
+ chargebackSubmitted = networkEvent.chargebackSubmitted
+ chargebackTimedOut = networkEvent.chargebackTimedOut
+ createdAt = networkEvent.createdAt
+ disputeFinancialTransactionId = networkEvent.disputeFinancialTransactionId
+ merchantPrearbitrationDeclineSubmitted =
+ networkEvent.merchantPrearbitrationDeclineSubmitted
+ merchantPrearbitrationReceived = networkEvent.merchantPrearbitrationReceived
+ merchantPrearbitrationTimedOut = networkEvent.merchantPrearbitrationTimedOut
+ represented = networkEvent.represented
+ representmentTimedOut = networkEvent.representmentTimedOut
+ userPrearbitrationAccepted = networkEvent.userPrearbitrationAccepted
+ userPrearbitrationDeclined = networkEvent.userPrearbitrationDeclined
+ userPrearbitrationSubmitted = networkEvent.userPrearbitrationSubmitted
+ userPrearbitrationTimedOut = networkEvent.userPrearbitrationTimedOut
+ userWithdrawalSubmitted = networkEvent.userWithdrawalSubmitted
+ additionalProperties = networkEvent.additionalProperties.toMutableMap()
+ }
+
+ /** The files attached to the Visa Card Dispute User Submission. */
+ fun attachmentFiles(attachmentFiles: List) =
+ attachmentFiles(JsonField.of(attachmentFiles))
+
+ /**
+ * Sets [Builder.attachmentFiles] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.attachmentFiles] with a well-typed
+ * `List` value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun attachmentFiles(attachmentFiles: JsonField>) = apply {
+ this.attachmentFiles = attachmentFiles.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [AttachmentFile] to [attachmentFiles].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addAttachmentFile(attachmentFile: AttachmentFile) = apply {
+ attachmentFiles =
+ (attachmentFiles ?: JsonField.of(mutableListOf())).also {
+ checkKnown("attachmentFiles", it).add(attachmentFile)
+ }
+ }
+
+ /**
+ * The category of the user submission. We may add additional possible values for
+ * this enum over time; your application should be able to handle such additions
+ * gracefully.
+ */
+ fun category(category: Category) = category(JsonField.of(category))
+
+ /**
+ * Sets [Builder.category] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.category] with a well-typed [Category] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun category(category: JsonField) = apply { this.category = category }
+
+ /**
+ * A Card Dispute Chargeback Accepted Visa Network Event object. This field will be
+ * present in the JSON response if and only if `category` is equal to
+ * `chargeback_accepted`. Contains the details specific to a chargeback accepted
+ * Visa Card Dispute Network Event, which represents that a chargeback has been
+ * accepted by the merchant.
+ */
+ fun chargebackAccepted(chargebackAccepted: JsonValue) = apply {
+ this.chargebackAccepted = chargebackAccepted
+ }
+
+ /**
+ * A Card Dispute Chargeback Submitted Visa Network Event object. This field will be
+ * present in the JSON response if and only if `category` is equal to
+ * `chargeback_submitted`. Contains the details specific to a chargeback submitted
+ * Visa Card Dispute Network Event, which represents that a chargeback has been
+ * submitted to the network.
+ */
+ fun chargebackSubmitted(chargebackSubmitted: JsonValue) = apply {
+ this.chargebackSubmitted = chargebackSubmitted
+ }
+
+ /**
+ * A Card Dispute Chargeback Timed Out Visa Network Event object. This field will be
+ * present in the JSON response if and only if `category` is equal to
+ * `chargeback_timed_out`. Contains the details specific to a chargeback timed out
+ * Visa Card Dispute Network Event, which represents that the chargeback has timed
+ * out in the user's favor.
+ */
+ fun chargebackTimedOut(chargebackTimedOut: JsonValue) = apply {
+ this.chargebackTimedOut = chargebackTimedOut
+ }
+
+ /**
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
+ * Visa Card Dispute Network Event was created.
+ */
+ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
+
+ /**
+ * Sets [Builder.createdAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime]
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun createdAt(createdAt: JsonField) = apply {
+ this.createdAt = createdAt
+ }
+
+ /**
+ * The dispute financial transaction that resulted from the network event, if any.
+ */
+ fun disputeFinancialTransactionId(disputeFinancialTransactionId: String?) =
+ disputeFinancialTransactionId(
+ JsonField.ofNullable(disputeFinancialTransactionId)
+ )
+
+ /**
+ * Alias for calling [Builder.disputeFinancialTransactionId] with
+ * `disputeFinancialTransactionId.orElse(null)`.
+ */
+ fun disputeFinancialTransactionId(disputeFinancialTransactionId: Optional) =
+ disputeFinancialTransactionId(disputeFinancialTransactionId.getOrNull())
+
+ /**
+ * Sets [Builder.disputeFinancialTransactionId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.disputeFinancialTransactionId] with a well-typed
+ * [String] value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun disputeFinancialTransactionId(
+ disputeFinancialTransactionId: JsonField
+ ) = apply { this.disputeFinancialTransactionId = disputeFinancialTransactionId }
+
+ /**
+ * A Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event
+ * object. This field will be present in the JSON response if and only if `category`
+ * is equal to `merchant_prearbitration_decline_submitted`. Contains the details
+ * specific to a merchant prearbitration decline submitted Visa Card Dispute Network
+ * Event, which represents that the user has declined the merchant's request for a
+ * prearbitration request decision in their favor.
+ */
+ fun merchantPrearbitrationDeclineSubmitted(
+ merchantPrearbitrationDeclineSubmitted: JsonValue
+ ) = apply {
+ this.merchantPrearbitrationDeclineSubmitted =
+ merchantPrearbitrationDeclineSubmitted
+ }
+
+ /**
+ * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `merchant_prearbitration_received`. Contains the details specific to a merchant
+ * prearbitration received Visa Card Dispute Network Event, which represents that
+ * the merchant has issued a prearbitration request in the user's favor.
+ */
+ fun merchantPrearbitrationReceived(
+ merchantPrearbitrationReceived: MerchantPrearbitrationReceived?
+ ) =
+ merchantPrearbitrationReceived(
+ JsonField.ofNullable(merchantPrearbitrationReceived)
+ )
+
+ /**
+ * Alias for calling [Builder.merchantPrearbitrationReceived] with
+ * `merchantPrearbitrationReceived.orElse(null)`.
+ */
+ fun merchantPrearbitrationReceived(
+ merchantPrearbitrationReceived: Optional
+ ) = merchantPrearbitrationReceived(merchantPrearbitrationReceived.getOrNull())
+
+ /**
+ * Sets [Builder.merchantPrearbitrationReceived] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantPrearbitrationReceived] with a
+ * well-typed [MerchantPrearbitrationReceived] value instead. This method is
+ * primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun merchantPrearbitrationReceived(
+ merchantPrearbitrationReceived: JsonField
+ ) = apply { this.merchantPrearbitrationReceived = merchantPrearbitrationReceived }
+
+ /**
+ * A Card Dispute Merchant Pre-Arbitration Timed Out Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `merchant_prearbitration_timed_out`. Contains the details specific to a merchant
+ * prearbitration timed out Visa Card Dispute Network Event, which represents that
+ * the user has timed out responding to the merchant's prearbitration request.
+ */
+ fun merchantPrearbitrationTimedOut(merchantPrearbitrationTimedOut: JsonValue) =
+ apply {
+ this.merchantPrearbitrationTimedOut = merchantPrearbitrationTimedOut
+ }
+
+ /**
+ * A Card Dispute Re-presented Visa Network Event object. This field will be present
+ * in the JSON response if and only if `category` is equal to `represented`.
+ * Contains the details specific to a re-presented Visa Card Dispute Network Event,
+ * which represents that the merchant has declined the user's chargeback and has
+ * re-presented the payment.
+ */
+ fun represented(represented: Represented?) =
+ represented(JsonField.ofNullable(represented))
+
+ /** Alias for calling [Builder.represented] with `represented.orElse(null)`. */
+ fun represented(represented: Optional) =
+ represented(represented.getOrNull())
+
+ /**
+ * Sets [Builder.represented] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.represented] with a well-typed [Represented]
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun represented(represented: JsonField) = apply {
+ this.represented = represented
+ }
+
+ /**
+ * A Card Dispute Re-presentment Timed Out Visa Network Event object. This field
+ * will be present in the JSON response if and only if `category` is equal to
+ * `representment_timed_out`. Contains the details specific to a re-presentment
+ * time-out Visa Card Dispute Network Event, which represents that the user did not
+ * respond to the re-presentment by the merchant within the time limit.
+ */
+ fun representmentTimedOut(representmentTimedOut: JsonValue) = apply {
+ this.representmentTimedOut = representmentTimedOut
+ }
+
+ /**
+ * A Card Dispute User Pre-Arbitration Accepted Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `user_prearbitration_accepted`. Contains the details specific to a user
+ * prearbitration accepted Visa Card Dispute Network Event, which represents that
+ * the merchant has accepted the user's prearbitration request in the user's favor.
+ */
+ fun userPrearbitrationAccepted(userPrearbitrationAccepted: JsonValue) = apply {
+ this.userPrearbitrationAccepted = userPrearbitrationAccepted
+ }
+
+ /**
+ * A Card Dispute User Pre-Arbitration Declined Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `user_prearbitration_declined`. Contains the details specific to a user
+ * prearbitration declined Visa Card Dispute Network Event, which represents that
+ * the merchant has declined the user's prearbitration request.
+ */
+ fun userPrearbitrationDeclined(userPrearbitrationDeclined: JsonValue) = apply {
+ this.userPrearbitrationDeclined = userPrearbitrationDeclined
+ }
+
+ /**
+ * A Card Dispute User Pre-Arbitration Submitted Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `user_prearbitration_submitted`. Contains the details specific to a user
+ * prearbitration submitted Visa Card Dispute Network Event, which represents that
+ * the user's request for prearbitration has been submitted to the network.
+ */
+ fun userPrearbitrationSubmitted(userPrearbitrationSubmitted: JsonValue) = apply {
+ this.userPrearbitrationSubmitted = userPrearbitrationSubmitted
+ }
+
+ /**
+ * A Card Dispute User Pre-Arbitration Timed Out Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `user_prearbitration_timed_out`. Contains the details specific to a user
+ * prearbitration timed out Visa Card Dispute Network Event, which represents that
+ * the merchant has timed out responding to the user's prearbitration request.
+ */
+ fun userPrearbitrationTimedOut(userPrearbitrationTimedOut: JsonValue) = apply {
+ this.userPrearbitrationTimedOut = userPrearbitrationTimedOut
+ }
+
+ /**
+ * A Card Dispute User Withdrawal Submitted Visa Network Event object. This field
+ * will be present in the JSON response if and only if `category` is equal to
+ * `user_withdrawal_submitted`. Contains the details specific to a user withdrawal
+ * submitted Visa Card Dispute Network Event, which represents that the user's
+ * request to withdraw the dispute has been submitted to the network.
+ */
+ fun userWithdrawalSubmitted(userWithdrawalSubmitted: JsonValue) = apply {
+ this.userWithdrawalSubmitted = userWithdrawalSubmitted
+ }
+
+ 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 [NetworkEvent].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .attachmentFiles()
+ * .category()
+ * .chargebackAccepted()
+ * .chargebackSubmitted()
+ * .chargebackTimedOut()
+ * .createdAt()
+ * .disputeFinancialTransactionId()
+ * .merchantPrearbitrationDeclineSubmitted()
+ * .merchantPrearbitrationReceived()
+ * .merchantPrearbitrationTimedOut()
+ * .represented()
+ * .representmentTimedOut()
+ * .userPrearbitrationAccepted()
+ * .userPrearbitrationDeclined()
+ * .userPrearbitrationSubmitted()
+ * .userPrearbitrationTimedOut()
+ * .userWithdrawalSubmitted()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): NetworkEvent =
+ NetworkEvent(
+ checkRequired("attachmentFiles", attachmentFiles).map { it.toImmutable() },
+ checkRequired("category", category),
+ checkRequired("chargebackAccepted", chargebackAccepted),
+ checkRequired("chargebackSubmitted", chargebackSubmitted),
+ checkRequired("chargebackTimedOut", chargebackTimedOut),
+ checkRequired("createdAt", createdAt),
+ checkRequired(
+ "disputeFinancialTransactionId",
+ disputeFinancialTransactionId,
+ ),
+ checkRequired(
+ "merchantPrearbitrationDeclineSubmitted",
+ merchantPrearbitrationDeclineSubmitted,
+ ),
+ checkRequired(
+ "merchantPrearbitrationReceived",
+ merchantPrearbitrationReceived,
+ ),
+ checkRequired(
+ "merchantPrearbitrationTimedOut",
+ merchantPrearbitrationTimedOut,
+ ),
+ checkRequired("represented", represented),
+ checkRequired("representmentTimedOut", representmentTimedOut),
+ checkRequired("userPrearbitrationAccepted", userPrearbitrationAccepted),
+ checkRequired("userPrearbitrationDeclined", userPrearbitrationDeclined),
+ checkRequired("userPrearbitrationSubmitted", userPrearbitrationSubmitted),
+ checkRequired("userPrearbitrationTimedOut", userPrearbitrationTimedOut),
+ checkRequired("userWithdrawalSubmitted", userWithdrawalSubmitted),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): NetworkEvent = apply {
+ if (validated) {
+ return@apply
+ }
+
+ attachmentFiles().forEach { it.validate() }
+ category().validate()
+ createdAt()
+ disputeFinancialTransactionId()
+ merchantPrearbitrationReceived().ifPresent { it.validate() }
+ represented().ifPresent { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 =
+ (attachmentFiles.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (category.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (createdAt.asKnown().isPresent) 1 else 0) +
+ (if (disputeFinancialTransactionId.asKnown().isPresent) 1 else 0) +
+ (merchantPrearbitrationReceived.asKnown().getOrNull()?.validity() ?: 0) +
+ (represented.asKnown().getOrNull()?.validity() ?: 0)
+
+ class AttachmentFile
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val fileId: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("file_id")
+ @ExcludeMissing
+ fileId: JsonField = JsonMissing.of()
+ ) : this(fileId, mutableMapOf())
+
+ /**
+ * The ID of the file attached to the Card Dispute.
+ *
+ * @throws IncreaseInvalidDataException 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 fileId(): String = fileId.getRequired("file_id")
+
+ /**
+ * Returns the raw JSON value of [fileId].
+ *
+ * Unlike [fileId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("file_id") @ExcludeMissing fun _fileId(): JsonField = fileId
+
+ @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 [AttachmentFile].
+ *
+ * The following fields are required:
+ * ```java
+ * .fileId()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AttachmentFile]. */
+ class Builder internal constructor() {
+
+ private var fileId: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(attachmentFile: AttachmentFile) = apply {
+ fileId = attachmentFile.fileId
+ additionalProperties = attachmentFile.additionalProperties.toMutableMap()
+ }
+
+ /** The ID of the file attached to the Card Dispute. */
+ fun fileId(fileId: String) = fileId(JsonField.of(fileId))
+
+ /**
+ * Sets [Builder.fileId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.fileId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun fileId(fileId: JsonField) = apply { this.fileId = fileId }
+
+ 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 [AttachmentFile].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .fileId()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AttachmentFile =
+ AttachmentFile(
+ checkRequired("fileId", fileId),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): AttachmentFile = apply {
+ if (validated) {
+ return@apply
+ }
+
+ fileId()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 (fileId.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AttachmentFile &&
+ fileId == other.fileId &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(fileId, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "AttachmentFile{fileId=$fileId, additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * The category of the user submission. We may add additional possible values for this
+ * enum over time; your application should be able to handle such additions gracefully.
+ */
+ class Category @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 {
+
+ /**
+ * Card Dispute Chargeback Accepted Visa Network Event: details will be under
+ * the `chargeback_accepted` object.
+ */
+ @JvmField val CHARGEBACK_ACCEPTED = of("chargeback_accepted")
+
+ /**
+ * Card Dispute Chargeback Submitted Visa Network Event: details will be under
+ * the `chargeback_submitted` object.
+ */
+ @JvmField val CHARGEBACK_SUBMITTED = of("chargeback_submitted")
+
+ /**
+ * Card Dispute Chargeback Timed Out Visa Network Event: details will be under
+ * the `chargeback_timed_out` object.
+ */
+ @JvmField val CHARGEBACK_TIMED_OUT = of("chargeback_timed_out")
+
+ /**
+ * Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event:
+ * details will be under the `merchant_prearbitration_decline_submitted` object.
+ */
+ @JvmField
+ val MERCHANT_PREARBITRATION_DECLINE_SUBMITTED =
+ of("merchant_prearbitration_decline_submitted")
+
+ /**
+ * Card Dispute Merchant Pre-Arbitration Received Visa Network Event: details
+ * will be under the `merchant_prearbitration_received` object.
+ */
+ @JvmField
+ val MERCHANT_PREARBITRATION_RECEIVED = of("merchant_prearbitration_received")
+
+ /**
+ * Card Dispute Merchant Pre-Arbitration Timed Out Visa Network Event: details
+ * will be under the `merchant_prearbitration_timed_out` object.
+ */
+ @JvmField
+ val MERCHANT_PREARBITRATION_TIMED_OUT = of("merchant_prearbitration_timed_out")
+
+ /**
+ * Card Dispute Re-presented Visa Network Event: details will be under the
+ * `represented` object.
+ */
+ @JvmField val REPRESENTED = of("represented")
+
+ /**
+ * Card Dispute Re-presentment Timed Out Visa Network Event: details will be
+ * under the `representment_timed_out` object.
+ */
+ @JvmField val REPRESENTMENT_TIMED_OUT = of("representment_timed_out")
+
+ /**
+ * Card Dispute User Pre-Arbitration Accepted Visa Network Event: details will
+ * be under the `user_prearbitration_accepted` object.
+ */
+ @JvmField val USER_PREARBITRATION_ACCEPTED = of("user_prearbitration_accepted")
+
+ /**
+ * Card Dispute User Pre-Arbitration Declined Visa Network Event: details will
+ * be under the `user_prearbitration_declined` object.
+ */
+ @JvmField val USER_PREARBITRATION_DECLINED = of("user_prearbitration_declined")
+
+ /**
+ * Card Dispute User Pre-Arbitration Submitted Visa Network Event: details will
+ * be under the `user_prearbitration_submitted` object.
+ */
+ @JvmField
+ val USER_PREARBITRATION_SUBMITTED = of("user_prearbitration_submitted")
+
+ /**
+ * Card Dispute User Pre-Arbitration Timed Out Visa Network Event: details will
+ * be under the `user_prearbitration_timed_out` object.
+ */
+ @JvmField
+ val USER_PREARBITRATION_TIMED_OUT = of("user_prearbitration_timed_out")
+
+ /**
+ * Card Dispute User Withdrawal Submitted Visa Network Event: details will be
+ * under the `user_withdrawal_submitted` object.
+ */
+ @JvmField val USER_WITHDRAWAL_SUBMITTED = of("user_withdrawal_submitted")
+
+ @JvmStatic fun of(value: String) = Category(JsonField.of(value))
+ }
+
+ /** An enum containing [Category]'s known values. */
+ enum class Known {
+ /**
+ * Card Dispute Chargeback Accepted Visa Network Event: details will be under
+ * the `chargeback_accepted` object.
+ */
+ CHARGEBACK_ACCEPTED,
+ /**
+ * Card Dispute Chargeback Submitted Visa Network Event: details will be under
+ * the `chargeback_submitted` object.
+ */
+ CHARGEBACK_SUBMITTED,
+ /**
+ * Card Dispute Chargeback Timed Out Visa Network Event: details will be under
+ * the `chargeback_timed_out` object.
+ */
+ CHARGEBACK_TIMED_OUT,
+ /**
+ * Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event:
+ * details will be under the `merchant_prearbitration_decline_submitted` object.
+ */
+ MERCHANT_PREARBITRATION_DECLINE_SUBMITTED,
+ /**
+ * Card Dispute Merchant Pre-Arbitration Received Visa Network Event: details
+ * will be under the `merchant_prearbitration_received` object.
+ */
+ MERCHANT_PREARBITRATION_RECEIVED,
+ /**
+ * Card Dispute Merchant Pre-Arbitration Timed Out Visa Network Event: details
+ * will be under the `merchant_prearbitration_timed_out` object.
+ */
+ MERCHANT_PREARBITRATION_TIMED_OUT,
+ /**
+ * Card Dispute Re-presented Visa Network Event: details will be under the
+ * `represented` object.
+ */
+ REPRESENTED,
+ /**
+ * Card Dispute Re-presentment Timed Out Visa Network Event: details will be
+ * under the `representment_timed_out` object.
+ */
+ REPRESENTMENT_TIMED_OUT,
+ /**
+ * Card Dispute User Pre-Arbitration Accepted Visa Network Event: details will
+ * be under the `user_prearbitration_accepted` object.
+ */
+ USER_PREARBITRATION_ACCEPTED,
+ /**
+ * Card Dispute User Pre-Arbitration Declined Visa Network Event: details will
+ * be under the `user_prearbitration_declined` object.
+ */
+ USER_PREARBITRATION_DECLINED,
+ /**
+ * Card Dispute User Pre-Arbitration Submitted Visa Network Event: details will
+ * be under the `user_prearbitration_submitted` object.
+ */
+ USER_PREARBITRATION_SUBMITTED,
+ /**
+ * Card Dispute User Pre-Arbitration Timed Out Visa Network Event: details will
+ * be under the `user_prearbitration_timed_out` object.
+ */
+ USER_PREARBITRATION_TIMED_OUT,
+ /**
+ * Card Dispute User Withdrawal Submitted Visa Network Event: details will be
+ * under the `user_withdrawal_submitted` object.
+ */
+ USER_WITHDRAWAL_SUBMITTED,
+ }
+
+ /**
+ * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Category] 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 Dispute Chargeback Accepted Visa Network Event: details will be under
+ * the `chargeback_accepted` object.
+ */
+ CHARGEBACK_ACCEPTED,
+ /**
+ * Card Dispute Chargeback Submitted Visa Network Event: details will be under
+ * the `chargeback_submitted` object.
+ */
+ CHARGEBACK_SUBMITTED,
+ /**
+ * Card Dispute Chargeback Timed Out Visa Network Event: details will be under
+ * the `chargeback_timed_out` object.
+ */
+ CHARGEBACK_TIMED_OUT,
+ /**
+ * Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event:
+ * details will be under the `merchant_prearbitration_decline_submitted` object.
+ */
+ MERCHANT_PREARBITRATION_DECLINE_SUBMITTED,
+ /**
+ * Card Dispute Merchant Pre-Arbitration Received Visa Network Event: details
+ * will be under the `merchant_prearbitration_received` object.
+ */
+ MERCHANT_PREARBITRATION_RECEIVED,
+ /**
+ * Card Dispute Merchant Pre-Arbitration Timed Out Visa Network Event: details
+ * will be under the `merchant_prearbitration_timed_out` object.
+ */
+ MERCHANT_PREARBITRATION_TIMED_OUT,
+ /**
+ * Card Dispute Re-presented Visa Network Event: details will be under the
+ * `represented` object.
+ */
+ REPRESENTED,
+ /**
+ * Card Dispute Re-presentment Timed Out Visa Network Event: details will be
+ * under the `representment_timed_out` object.
+ */
+ REPRESENTMENT_TIMED_OUT,
+ /**
+ * Card Dispute User Pre-Arbitration Accepted Visa Network Event: details will
+ * be under the `user_prearbitration_accepted` object.
+ */
+ USER_PREARBITRATION_ACCEPTED,
+ /**
+ * Card Dispute User Pre-Arbitration Declined Visa Network Event: details will
+ * be under the `user_prearbitration_declined` object.
+ */
+ USER_PREARBITRATION_DECLINED,
+ /**
+ * Card Dispute User Pre-Arbitration Submitted Visa Network Event: details will
+ * be under the `user_prearbitration_submitted` object.
+ */
+ USER_PREARBITRATION_SUBMITTED,
+ /**
+ * Card Dispute User Pre-Arbitration Timed Out Visa Network Event: details will
+ * be under the `user_prearbitration_timed_out` object.
+ */
+ USER_PREARBITRATION_TIMED_OUT,
+ /**
+ * Card Dispute User Withdrawal Submitted Visa Network Event: details will be
+ * under the `user_withdrawal_submitted` object.
+ */
+ USER_WITHDRAWAL_SUBMITTED,
+ /**
+ * An enum member indicating that [Category] 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) {
+ CHARGEBACK_ACCEPTED -> Value.CHARGEBACK_ACCEPTED
+ CHARGEBACK_SUBMITTED -> Value.CHARGEBACK_SUBMITTED
+ CHARGEBACK_TIMED_OUT -> Value.CHARGEBACK_TIMED_OUT
+ MERCHANT_PREARBITRATION_DECLINE_SUBMITTED ->
+ Value.MERCHANT_PREARBITRATION_DECLINE_SUBMITTED
+ MERCHANT_PREARBITRATION_RECEIVED -> Value.MERCHANT_PREARBITRATION_RECEIVED
+ MERCHANT_PREARBITRATION_TIMED_OUT -> Value.MERCHANT_PREARBITRATION_TIMED_OUT
+ REPRESENTED -> Value.REPRESENTED
+ REPRESENTMENT_TIMED_OUT -> Value.REPRESENTMENT_TIMED_OUT
+ USER_PREARBITRATION_ACCEPTED -> Value.USER_PREARBITRATION_ACCEPTED
+ USER_PREARBITRATION_DECLINED -> Value.USER_PREARBITRATION_DECLINED
+ USER_PREARBITRATION_SUBMITTED -> Value.USER_PREARBITRATION_SUBMITTED
+ USER_PREARBITRATION_TIMED_OUT -> Value.USER_PREARBITRATION_TIMED_OUT
+ USER_WITHDRAWAL_SUBMITTED -> Value.USER_WITHDRAWAL_SUBMITTED
+ 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 IncreaseInvalidDataException if this class instance's value is a not a
+ * known member.
+ */
+ fun known(): Known =
+ when (this) {
+ CHARGEBACK_ACCEPTED -> Known.CHARGEBACK_ACCEPTED
+ CHARGEBACK_SUBMITTED -> Known.CHARGEBACK_SUBMITTED
+ CHARGEBACK_TIMED_OUT -> Known.CHARGEBACK_TIMED_OUT
+ MERCHANT_PREARBITRATION_DECLINE_SUBMITTED ->
+ Known.MERCHANT_PREARBITRATION_DECLINE_SUBMITTED
+ MERCHANT_PREARBITRATION_RECEIVED -> Known.MERCHANT_PREARBITRATION_RECEIVED
+ MERCHANT_PREARBITRATION_TIMED_OUT -> Known.MERCHANT_PREARBITRATION_TIMED_OUT
+ REPRESENTED -> Known.REPRESENTED
+ REPRESENTMENT_TIMED_OUT -> Known.REPRESENTMENT_TIMED_OUT
+ USER_PREARBITRATION_ACCEPTED -> Known.USER_PREARBITRATION_ACCEPTED
+ USER_PREARBITRATION_DECLINED -> Known.USER_PREARBITRATION_DECLINED
+ USER_PREARBITRATION_SUBMITTED -> Known.USER_PREARBITRATION_SUBMITTED
+ USER_PREARBITRATION_TIMED_OUT -> Known.USER_PREARBITRATION_TIMED_OUT
+ USER_WITHDRAWAL_SUBMITTED -> Known.USER_WITHDRAWAL_SUBMITTED
+ else -> throw IncreaseInvalidDataException("Unknown Category: $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 IncreaseInvalidDataException if this class instance's value does not have
+ * the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Category = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ 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 Category && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /**
+ * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This
+ * field will be present in the JSON response if and only if `category` is equal to
+ * `merchant_prearbitration_received`. Contains the details specific to a merchant
+ * prearbitration received Visa Card Dispute Network Event, which represents that the
+ * merchant has issued a prearbitration request in the user's favor.
+ */
+ class MerchantPrearbitrationReceived
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val cardholderNoLongerDisputes: JsonField,
+ private val compellingEvidence: JsonField,
+ private val creditOrReversalProcessed: JsonField,
+ private val delayedChargeTransaction: JsonField,
+ private val evidenceOfImprint: JsonField,
+ private val invalidDispute: JsonField,
+ private val nonFiatCurrencyOrNonFungibleTokenReceived:
+ JsonField,
+ private val priorUndisputedNonFraudTransactions:
+ JsonField,
+ private val reason: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("cardholder_no_longer_disputes")
+ @ExcludeMissing
+ cardholderNoLongerDisputes: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("compelling_evidence")
+ @ExcludeMissing
+ compellingEvidence: JsonField = JsonMissing.of(),
+ @JsonProperty("credit_or_reversal_processed")
+ @ExcludeMissing
+ creditOrReversalProcessed: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("delayed_charge_transaction")
+ @ExcludeMissing
+ delayedChargeTransaction: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("evidence_of_imprint")
+ @ExcludeMissing
+ evidenceOfImprint: JsonField = JsonMissing.of(),
+ @JsonProperty("invalid_dispute")
+ @ExcludeMissing
+ invalidDispute: JsonField = JsonMissing.of(),
+ @JsonProperty("non_fiat_currency_or_non_fungible_token_received")
+ @ExcludeMissing
+ nonFiatCurrencyOrNonFungibleTokenReceived:
+ JsonField =
+ JsonMissing.of(),
+ @JsonProperty("prior_undisputed_non_fraud_transactions")
+ @ExcludeMissing
+ priorUndisputedNonFraudTransactions:
+ JsonField =
+ JsonMissing.of(),
+ @JsonProperty("reason")
+ @ExcludeMissing
+ reason: JsonField = JsonMissing.of(),
+ ) : this(
+ cardholderNoLongerDisputes,
+ compellingEvidence,
+ creditOrReversalProcessed,
+ delayedChargeTransaction,
+ evidenceOfImprint,
+ invalidDispute,
+ nonFiatCurrencyOrNonFungibleTokenReceived,
+ priorUndisputedNonFraudTransactions,
+ reason,
+ mutableMapOf(),
+ )
+
+ /**
+ * Cardholder no longer disputes details. Present if and only if `reason` is
+ * `cardholder_no_longer_disputes`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun cardholderNoLongerDisputes(): Optional =
+ cardholderNoLongerDisputes.getOptional("cardholder_no_longer_disputes")
+
+ /**
+ * Compelling evidence details. Present if and only if `reason` is
+ * `compelling_evidence`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun compellingEvidence(): Optional =
+ compellingEvidence.getOptional("compelling_evidence")
+
+ /**
+ * Credit or reversal processed details. Present if and only if `reason` is
+ * `credit_or_reversal_processed`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun creditOrReversalProcessed(): Optional =
+ creditOrReversalProcessed.getOptional("credit_or_reversal_processed")
+
+ /**
+ * Delayed charge transaction details. Present if and only if `reason` is
+ * `delayed_charge_transaction`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun delayedChargeTransaction(): Optional =
+ delayedChargeTransaction.getOptional("delayed_charge_transaction")
+
+ /**
+ * Evidence of imprint details. Present if and only if `reason` is
+ * `evidence_of_imprint`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun evidenceOfImprint(): Optional =
+ evidenceOfImprint.getOptional("evidence_of_imprint")
+
+ /**
+ * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun invalidDispute(): Optional =
+ invalidDispute.getOptional("invalid_dispute")
+
+ /**
+ * Non-fiat currency or non-fungible token received details. Present if and only if
+ * `reason` is `non_fiat_currency_or_non_fungible_token_received`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun nonFiatCurrencyOrNonFungibleTokenReceived():
+ Optional =
+ nonFiatCurrencyOrNonFungibleTokenReceived.getOptional(
+ "non_fiat_currency_or_non_fungible_token_received"
+ )
+
+ /**
+ * Prior undisputed non-fraud transactions details. Present if and only if `reason`
+ * is `prior_undisputed_non_fraud_transactions`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun priorUndisputedNonFraudTransactions():
+ Optional =
+ priorUndisputedNonFraudTransactions.getOptional(
+ "prior_undisputed_non_fraud_transactions"
+ )
+
+ /**
+ * The reason the merchant re-presented the dispute.
+ *
+ * @throws IncreaseInvalidDataException 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")
+
+ /**
+ * Returns the raw JSON value of [cardholderNoLongerDisputes].
+ *
+ * Unlike [cardholderNoLongerDisputes], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("cardholder_no_longer_disputes")
+ @ExcludeMissing
+ fun _cardholderNoLongerDisputes(): JsonField =
+ cardholderNoLongerDisputes
+
+ /**
+ * Returns the raw JSON value of [compellingEvidence].
+ *
+ * Unlike [compellingEvidence], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("compelling_evidence")
+ @ExcludeMissing
+ fun _compellingEvidence(): JsonField = compellingEvidence
+
+ /**
+ * Returns the raw JSON value of [creditOrReversalProcessed].
+ *
+ * Unlike [creditOrReversalProcessed], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("credit_or_reversal_processed")
+ @ExcludeMissing
+ fun _creditOrReversalProcessed(): JsonField =
+ creditOrReversalProcessed
+
+ /**
+ * Returns the raw JSON value of [delayedChargeTransaction].
+ *
+ * Unlike [delayedChargeTransaction], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("delayed_charge_transaction")
+ @ExcludeMissing
+ fun _delayedChargeTransaction(): JsonField =
+ delayedChargeTransaction
+
+ /**
+ * Returns the raw JSON value of [evidenceOfImprint].
+ *
+ * Unlike [evidenceOfImprint], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("evidence_of_imprint")
+ @ExcludeMissing
+ fun _evidenceOfImprint(): JsonField = evidenceOfImprint
+
+ /**
+ * Returns the raw JSON value of [invalidDispute].
+ *
+ * Unlike [invalidDispute], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("invalid_dispute")
+ @ExcludeMissing
+ fun _invalidDispute(): JsonField = invalidDispute
+
+ /**
+ * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived].
+ *
+ * Unlike [nonFiatCurrencyOrNonFungibleTokenReceived], this method doesn't throw if
+ * the JSON field has an unexpected type.
+ */
+ @JsonProperty("non_fiat_currency_or_non_fungible_token_received")
+ @ExcludeMissing
+ fun _nonFiatCurrencyOrNonFungibleTokenReceived():
+ JsonField =
+ nonFiatCurrencyOrNonFungibleTokenReceived
+
+ /**
+ * Returns the raw JSON value of [priorUndisputedNonFraudTransactions].
+ *
+ * Unlike [priorUndisputedNonFraudTransactions], this method doesn't throw if the
+ * JSON field has an unexpected type.
+ */
+ @JsonProperty("prior_undisputed_non_fraud_transactions")
+ @ExcludeMissing
+ fun _priorUndisputedNonFraudTransactions():
+ JsonField =
+ priorUndisputedNonFraudTransactions
+
+ /**
+ * 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
+
+ @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
+ * [MerchantPrearbitrationReceived].
+ *
+ * The following fields are required:
+ * ```java
+ * .cardholderNoLongerDisputes()
+ * .compellingEvidence()
+ * .creditOrReversalProcessed()
+ * .delayedChargeTransaction()
+ * .evidenceOfImprint()
+ * .invalidDispute()
+ * .nonFiatCurrencyOrNonFungibleTokenReceived()
+ * .priorUndisputedNonFraudTransactions()
+ * .reason()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [MerchantPrearbitrationReceived]. */
+ class Builder internal constructor() {
+
+ private var cardholderNoLongerDisputes: JsonField? =
+ null
+ private var compellingEvidence: JsonField? = null
+ private var creditOrReversalProcessed: JsonField? =
+ null
+ private var delayedChargeTransaction: JsonField? =
+ null
+ private var evidenceOfImprint: JsonField? = null
+ private var invalidDispute: JsonField? = null
+ private var nonFiatCurrencyOrNonFungibleTokenReceived:
+ JsonField? =
+ null
+ private var priorUndisputedNonFraudTransactions:
+ JsonField? =
+ null
+ private var reason: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(
+ merchantPrearbitrationReceived: MerchantPrearbitrationReceived
+ ) = apply {
+ cardholderNoLongerDisputes =
+ merchantPrearbitrationReceived.cardholderNoLongerDisputes
+ compellingEvidence = merchantPrearbitrationReceived.compellingEvidence
+ creditOrReversalProcessed =
+ merchantPrearbitrationReceived.creditOrReversalProcessed
+ delayedChargeTransaction =
+ merchantPrearbitrationReceived.delayedChargeTransaction
+ evidenceOfImprint = merchantPrearbitrationReceived.evidenceOfImprint
+ invalidDispute = merchantPrearbitrationReceived.invalidDispute
+ nonFiatCurrencyOrNonFungibleTokenReceived =
+ merchantPrearbitrationReceived.nonFiatCurrencyOrNonFungibleTokenReceived
+ priorUndisputedNonFraudTransactions =
+ merchantPrearbitrationReceived.priorUndisputedNonFraudTransactions
+ reason = merchantPrearbitrationReceived.reason
+ additionalProperties =
+ merchantPrearbitrationReceived.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * Cardholder no longer disputes details. Present if and only if `reason` is
+ * `cardholder_no_longer_disputes`.
+ */
+ fun cardholderNoLongerDisputes(
+ cardholderNoLongerDisputes: CardholderNoLongerDisputes?
+ ) = cardholderNoLongerDisputes(JsonField.ofNullable(cardholderNoLongerDisputes))
+
+ /**
+ * Alias for calling [Builder.cardholderNoLongerDisputes] with
+ * `cardholderNoLongerDisputes.orElse(null)`.
+ */
+ fun cardholderNoLongerDisputes(
+ cardholderNoLongerDisputes: Optional
+ ) = cardholderNoLongerDisputes(cardholderNoLongerDisputes.getOrNull())
+
+ /**
+ * Sets [Builder.cardholderNoLongerDisputes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cardholderNoLongerDisputes] with a
+ * well-typed [CardholderNoLongerDisputes] value instead. This method is
+ * primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun cardholderNoLongerDisputes(
+ cardholderNoLongerDisputes: JsonField
+ ) = apply { this.cardholderNoLongerDisputes = cardholderNoLongerDisputes }
+
+ /**
+ * Compelling evidence details. Present if and only if `reason` is
+ * `compelling_evidence`.
+ */
+ fun compellingEvidence(compellingEvidence: CompellingEvidence?) =
+ compellingEvidence(JsonField.ofNullable(compellingEvidence))
+
+ /**
+ * Alias for calling [Builder.compellingEvidence] with
+ * `compellingEvidence.orElse(null)`.
+ */
+ fun compellingEvidence(compellingEvidence: Optional) =
+ compellingEvidence(compellingEvidence.getOrNull())
+
+ /**
+ * Sets [Builder.compellingEvidence] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.compellingEvidence] with a well-typed
+ * [CompellingEvidence] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun compellingEvidence(compellingEvidence: JsonField) =
+ apply {
+ this.compellingEvidence = compellingEvidence
+ }
+
+ /**
+ * Credit or reversal processed details. Present if and only if `reason` is
+ * `credit_or_reversal_processed`.
+ */
+ fun creditOrReversalProcessed(
+ creditOrReversalProcessed: CreditOrReversalProcessed?
+ ) = creditOrReversalProcessed(JsonField.ofNullable(creditOrReversalProcessed))
+
+ /**
+ * Alias for calling [Builder.creditOrReversalProcessed] with
+ * `creditOrReversalProcessed.orElse(null)`.
+ */
+ fun creditOrReversalProcessed(
+ creditOrReversalProcessed: Optional
+ ) = creditOrReversalProcessed(creditOrReversalProcessed.getOrNull())
+
+ /**
+ * Sets [Builder.creditOrReversalProcessed] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.creditOrReversalProcessed] with a well-typed
+ * [CreditOrReversalProcessed] value instead. This method is primarily for
+ * setting the field to an undocumented or not yet supported value.
+ */
+ fun creditOrReversalProcessed(
+ creditOrReversalProcessed: JsonField
+ ) = apply { this.creditOrReversalProcessed = creditOrReversalProcessed }
+
+ /**
+ * Delayed charge transaction details. Present if and only if `reason` is
+ * `delayed_charge_transaction`.
+ */
+ fun delayedChargeTransaction(
+ delayedChargeTransaction: DelayedChargeTransaction?
+ ) = delayedChargeTransaction(JsonField.ofNullable(delayedChargeTransaction))
+
+ /**
+ * Alias for calling [Builder.delayedChargeTransaction] with
+ * `delayedChargeTransaction.orElse(null)`.
+ */
+ fun delayedChargeTransaction(
+ delayedChargeTransaction: Optional
+ ) = delayedChargeTransaction(delayedChargeTransaction.getOrNull())
+
+ /**
+ * Sets [Builder.delayedChargeTransaction] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.delayedChargeTransaction] with a well-typed
+ * [DelayedChargeTransaction] value instead. This method is primarily for
+ * setting the field to an undocumented or not yet supported value.
+ */
+ fun delayedChargeTransaction(
+ delayedChargeTransaction: JsonField
+ ) = apply { this.delayedChargeTransaction = delayedChargeTransaction }
+
+ /**
+ * Evidence of imprint details. Present if and only if `reason` is
+ * `evidence_of_imprint`.
+ */
+ fun evidenceOfImprint(evidenceOfImprint: EvidenceOfImprint?) =
+ evidenceOfImprint(JsonField.ofNullable(evidenceOfImprint))
+
+ /**
+ * Alias for calling [Builder.evidenceOfImprint] with
+ * `evidenceOfImprint.orElse(null)`.
+ */
+ fun evidenceOfImprint(evidenceOfImprint: Optional) =
+ evidenceOfImprint(evidenceOfImprint.getOrNull())
+
+ /**
+ * Sets [Builder.evidenceOfImprint] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.evidenceOfImprint] with a well-typed
+ * [EvidenceOfImprint] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun evidenceOfImprint(evidenceOfImprint: JsonField) = apply {
+ this.evidenceOfImprint = evidenceOfImprint
+ }
+
+ /**
+ * Invalid dispute details. Present if and only if `reason` is
+ * `invalid_dispute`.
+ */
+ fun invalidDispute(invalidDispute: InvalidDispute?) =
+ invalidDispute(JsonField.ofNullable(invalidDispute))
+
+ /**
+ * Alias for calling [Builder.invalidDispute] with
+ * `invalidDispute.orElse(null)`.
+ */
+ fun invalidDispute(invalidDispute: Optional) =
+ invalidDispute(invalidDispute.getOrNull())
+
+ /**
+ * Sets [Builder.invalidDispute] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.invalidDispute] with a well-typed
+ * [InvalidDispute] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun invalidDispute(invalidDispute: JsonField) = apply {
+ this.invalidDispute = invalidDispute
+ }
+
+ /**
+ * Non-fiat currency or non-fungible token received details. Present if and only
+ * if `reason` is `non_fiat_currency_or_non_fungible_token_received`.
+ */
+ fun nonFiatCurrencyOrNonFungibleTokenReceived(
+ nonFiatCurrencyOrNonFungibleTokenReceived:
+ NonFiatCurrencyOrNonFungibleTokenReceived?
+ ) =
+ nonFiatCurrencyOrNonFungibleTokenReceived(
+ JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenReceived)
+ )
+
+ /**
+ * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] with
+ * `nonFiatCurrencyOrNonFungibleTokenReceived.orElse(null)`.
+ */
+ fun nonFiatCurrencyOrNonFungibleTokenReceived(
+ nonFiatCurrencyOrNonFungibleTokenReceived:
+ Optional
+ ) =
+ nonFiatCurrencyOrNonFungibleTokenReceived(
+ nonFiatCurrencyOrNonFungibleTokenReceived.getOrNull()
+ )
+
+ /**
+ * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] to an arbitrary JSON
+ * value.
+ *
+ * You should usually call [Builder.nonFiatCurrencyOrNonFungibleTokenReceived]
+ * with a well-typed [NonFiatCurrencyOrNonFungibleTokenReceived] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun nonFiatCurrencyOrNonFungibleTokenReceived(
+ nonFiatCurrencyOrNonFungibleTokenReceived:
+ JsonField
+ ) = apply {
+ this.nonFiatCurrencyOrNonFungibleTokenReceived =
+ nonFiatCurrencyOrNonFungibleTokenReceived
+ }
+
+ /**
+ * Prior undisputed non-fraud transactions details. Present if and only if
+ * `reason` is `prior_undisputed_non_fraud_transactions`.
+ */
+ fun priorUndisputedNonFraudTransactions(
+ priorUndisputedNonFraudTransactions: PriorUndisputedNonFraudTransactions?
+ ) =
+ priorUndisputedNonFraudTransactions(
+ JsonField.ofNullable(priorUndisputedNonFraudTransactions)
+ )
+
+ /**
+ * Alias for calling [Builder.priorUndisputedNonFraudTransactions] with
+ * `priorUndisputedNonFraudTransactions.orElse(null)`.
+ */
+ fun priorUndisputedNonFraudTransactions(
+ priorUndisputedNonFraudTransactions:
+ Optional
+ ) =
+ priorUndisputedNonFraudTransactions(
+ priorUndisputedNonFraudTransactions.getOrNull()
+ )
+
+ /**
+ * Sets [Builder.priorUndisputedNonFraudTransactions] to an arbitrary JSON
+ * value.
+ *
+ * You should usually call [Builder.priorUndisputedNonFraudTransactions] with a
+ * well-typed [PriorUndisputedNonFraudTransactions] value instead. This method
+ * is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun priorUndisputedNonFraudTransactions(
+ priorUndisputedNonFraudTransactions:
+ JsonField