diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 24f979195..09eb6e203 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.328.0"
+ ".": "0.329.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 14e640b1e..f6bbc76b8 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 217
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-61210b27ac135ed841515ad3c3dfedaf42dc1398b0a3ed63bbd6c154d1b31a6a.yml
-openapi_spec_hash: b0d2957f6269776252f0ddaa6489772a
-config_hash: e1885b38eded054b77308a024c5d80cc
+configured_endpoints: 213
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-fc17d091731928c882b2272ea5de831cafcbf237a7887652a5f133c29cb1bbc4.yml
+openapi_spec_hash: aad429d087b7557be4103d1309cd81a0
+config_hash: e1e8bc2138a13f290956ae6687f099cd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f0d9123e2..e937fc0ef 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.329.0 (2025-09-17)
+
+Full Changelog: [v0.328.0...v0.329.0](https://github.com/Increase/increase-java/compare/v0.328.0...v0.329.0)
+
+### Features
+
+* **api:** api update ([efaab46](https://github.com/Increase/increase-java/commit/efaab46aafff0c6af9a18189d4b92b77615f8b56))
+
## 0.328.0 (2025-09-17)
Full Changelog: [v0.327.0...v0.328.0](https://github.com/Increase/increase-java/compare/v0.327.0...v0.328.0)
diff --git a/README.md b/README.md
index 88c465de9..026159446 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.328.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.328.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.329.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.329.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.328.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.329.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.328.0")
+implementation("com.increase.api:increase-java:0.329.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.328.0")
com.increase.api
increase-java
- 0.328.0
+ 0.329.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index cc729f654..081f65a96 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.328.0" // x-release-please-version
+ version = "0.329.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 4de8c0ea2..952133bfb 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,7 +12,6 @@ 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
@@ -109,8 +108,6 @@ interface IncreaseClient {
fun cardPurchaseSupplements(): CardPurchaseSupplementService
- fun cardDisputes(): CardDisputeService
-
fun physicalCards(): PhysicalCardService
fun digitalCardProfiles(): DigitalCardProfileService
@@ -244,8 +241,6 @@ 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 ac800b994..254077478 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,7 +12,6 @@ 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
@@ -109,8 +108,6 @@ interface IncreaseClientAsync {
fun cardPurchaseSupplements(): CardPurchaseSupplementServiceAsync
- fun cardDisputes(): CardDisputeServiceAsync
-
fun physicalCards(): PhysicalCardServiceAsync
fun digitalCardProfiles(): DigitalCardProfileServiceAsync
@@ -248,8 +245,6 @@ 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 1adb82f42..7c881b56d 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,8 +22,6 @@ 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
@@ -157,10 +155,6 @@ 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)
}
@@ -374,8 +368,6 @@ 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
@@ -508,10 +500,6 @@ 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)
}
@@ -730,8 +718,6 @@ 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 0f57c4411..b2c6d0aa0 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,8 +22,6 @@ 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
@@ -155,10 +153,6 @@ 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)
}
@@ -358,8 +352,6 @@ 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
@@ -491,10 +483,6 @@ 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)
}
@@ -711,8 +699,6 @@ 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
deleted file mode 100644
index ae014c8d5..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt
+++ /dev/null
@@ -1,2053 +0,0 @@
-// 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.checkRequired
-import com.increase.api.errors.IncreaseInvalidDataException
-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 return the
- * funds if appropriate.
- */
-class CardDispute
-private constructor(
- private val id: JsonField,
- private val acceptance: JsonField,
- private val amount: JsonField,
- private val createdAt: JsonField,
- private val disputedTransactionId: JsonField,
- private val explanation: JsonField,
- private val idempotencyKey: JsonField,
- private val loss: JsonField,
- private val rejection: JsonField,
- private val status: JsonField,
- private val type: JsonField,
- private val win: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("acceptance")
- @ExcludeMissing
- acceptance: JsonField = JsonMissing.of(),
- @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
- @JsonProperty("created_at")
- @ExcludeMissing
- createdAt: JsonField = JsonMissing.of(),
- @JsonProperty("disputed_transaction_id")
- @ExcludeMissing
- disputedTransactionId: JsonField = JsonMissing.of(),
- @JsonProperty("explanation")
- @ExcludeMissing
- explanation: JsonField = JsonMissing.of(),
- @JsonProperty("idempotency_key")
- @ExcludeMissing
- idempotencyKey: JsonField = JsonMissing.of(),
- @JsonProperty("loss") @ExcludeMissing loss: JsonField = JsonMissing.of(),
- @JsonProperty("rejection")
- @ExcludeMissing
- rejection: JsonField = JsonMissing.of(),
- @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
- @JsonProperty("win") @ExcludeMissing win: JsonField = JsonMissing.of(),
- ) : this(
- id,
- acceptance,
- amount,
- createdAt,
- disputedTransactionId,
- explanation,
- idempotencyKey,
- loss,
- rejection,
- status,
- type,
- 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")
-
- /**
- * If the Card Dispute's status is `accepted`, this will contain details of the successful
- * dispute.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun acceptance(): Optional = acceptance.getOptional("acceptance")
-
- /**
- * The amount of the dispute, if provided, or the transaction amount otherwise.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun amount(): Optional = amount.getOptional("amount")
-
- /**
- * 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")
-
- /**
- * Why you disputed the Transaction in question.
- *
- * @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 explanation(): String = explanation.getRequired("explanation")
-
- /**
- * 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")
-
- /**
- * If the Card Dispute's status is `rejected`, this will contain details of the unsuccessful
- * dispute.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun rejection(): Optional = rejection.getOptional("rejection")
-
- /**
- * The results of the Dispute investigation.
- *
- * @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")
-
- /**
- * 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 [acceptance].
- *
- * Unlike [acceptance], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("acceptance")
- @ExcludeMissing
- fun _acceptance(): JsonField = acceptance
-
- /**
- * 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 [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 [explanation].
- *
- * Unlike [explanation], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("explanation") @ExcludeMissing fun _explanation(): JsonField = explanation
-
- /**
- * 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 [rejection].
- *
- * Unlike [rejection], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("rejection") @ExcludeMissing fun _rejection(): JsonField = rejection
-
- /**
- * 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 [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()
- * .acceptance()
- * .amount()
- * .createdAt()
- * .disputedTransactionId()
- * .explanation()
- * .idempotencyKey()
- * .loss()
- * .rejection()
- * .status()
- * .type()
- * .win()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [CardDispute]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var acceptance: JsonField? = null
- private var amount: JsonField? = null
- private var createdAt: JsonField? = null
- private var disputedTransactionId: JsonField? = null
- private var explanation: JsonField? = null
- private var idempotencyKey: JsonField? = null
- private var loss: JsonField? = null
- private var rejection: JsonField? = null
- private var status: JsonField? = null
- private var type: JsonField? = null
- private var win: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(cardDispute: CardDispute) = apply {
- id = cardDispute.id
- acceptance = cardDispute.acceptance
- amount = cardDispute.amount
- createdAt = cardDispute.createdAt
- disputedTransactionId = cardDispute.disputedTransactionId
- explanation = cardDispute.explanation
- idempotencyKey = cardDispute.idempotencyKey
- loss = cardDispute.loss
- rejection = cardDispute.rejection
- status = cardDispute.status
- type = cardDispute.type
- 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 }
-
- /**
- * If the Card Dispute's status is `accepted`, this will contain details of the successful
- * dispute.
- */
- fun acceptance(acceptance: Acceptance?) = acceptance(JsonField.ofNullable(acceptance))
-
- /** Alias for calling [Builder.acceptance] with `acceptance.orElse(null)`. */
- fun acceptance(acceptance: Optional) = acceptance(acceptance.getOrNull())
-
- /**
- * Sets [Builder.acceptance] to an arbitrary JSON value.
- *
- * You should usually call [Builder.acceptance] with a well-typed [Acceptance] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun acceptance(acceptance: JsonField) = apply { this.acceptance = acceptance }
-
- /** The amount of the dispute, if provided, or the transaction amount otherwise. */
- fun amount(amount: Long?) = amount(JsonField.ofNullable(amount))
-
- /**
- * Alias for [Builder.amount].
- *
- * This unboxed primitive overload exists for backwards compatibility.
- */
- fun amount(amount: Long) = amount(amount as Long?)
-
- /** Alias for calling [Builder.amount] with `amount.orElse(null)`. */
- fun amount(amount: Optional) = amount(amount.getOrNull())
-
- /**
- * 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 [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
- }
-
- /** Why you disputed the Transaction in question. */
- fun explanation(explanation: String) = explanation(JsonField.of(explanation))
-
- /**
- * Sets [Builder.explanation] to an arbitrary JSON value.
- *
- * You should usually call [Builder.explanation] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun explanation(explanation: JsonField) = apply { this.explanation = explanation }
-
- /**
- * 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 }
-
- /**
- * If the Card Dispute's status is `rejected`, this will contain details of the unsuccessful
- * dispute.
- */
- fun rejection(rejection: Rejection?) = rejection(JsonField.ofNullable(rejection))
-
- /** Alias for calling [Builder.rejection] with `rejection.orElse(null)`. */
- fun rejection(rejection: Optional) = rejection(rejection.getOrNull())
-
- /**
- * Sets [Builder.rejection] to an arbitrary JSON value.
- *
- * You should usually call [Builder.rejection] with a well-typed [Rejection] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun rejection(rejection: JsonField) = apply { this.rejection = rejection }
-
- /** The results of the Dispute investigation. */
- 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 }
-
- /** 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()
- * .acceptance()
- * .amount()
- * .createdAt()
- * .disputedTransactionId()
- * .explanation()
- * .idempotencyKey()
- * .loss()
- * .rejection()
- * .status()
- * .type()
- * .win()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): CardDispute =
- CardDispute(
- checkRequired("id", id),
- checkRequired("acceptance", acceptance),
- checkRequired("amount", amount),
- checkRequired("createdAt", createdAt),
- checkRequired("disputedTransactionId", disputedTransactionId),
- checkRequired("explanation", explanation),
- checkRequired("idempotencyKey", idempotencyKey),
- checkRequired("loss", loss),
- checkRequired("rejection", rejection),
- checkRequired("status", status),
- checkRequired("type", type),
- checkRequired("win", win),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): CardDispute = apply {
- if (validated) {
- return@apply
- }
-
- id()
- acceptance().ifPresent { it.validate() }
- amount()
- createdAt()
- disputedTransactionId()
- explanation()
- idempotencyKey()
- loss().ifPresent { it.validate() }
- rejection().ifPresent { it.validate() }
- status().validate()
- type().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) +
- (acceptance.asKnown().getOrNull()?.validity() ?: 0) +
- (if (amount.asKnown().isPresent) 1 else 0) +
- (if (createdAt.asKnown().isPresent) 1 else 0) +
- (if (disputedTransactionId.asKnown().isPresent) 1 else 0) +
- (if (explanation.asKnown().isPresent) 1 else 0) +
- (if (idempotencyKey.asKnown().isPresent) 1 else 0) +
- (loss.asKnown().getOrNull()?.validity() ?: 0) +
- (rejection.asKnown().getOrNull()?.validity() ?: 0) +
- (status.asKnown().getOrNull()?.validity() ?: 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0) +
- (win.asKnown().getOrNull()?.validity() ?: 0)
-
- /**
- * If the Card Dispute's status is `accepted`, this will contain details of the successful
- * dispute.
- */
- class Acceptance
- private constructor(
- private val acceptedAt: JsonField,
- private val cardDisputeId: JsonField,
- private val transactionId: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("accepted_at")
- @ExcludeMissing
- acceptedAt: JsonField = JsonMissing.of(),
- @JsonProperty("card_dispute_id")
- @ExcludeMissing
- cardDisputeId: JsonField = JsonMissing.of(),
- @JsonProperty("transaction_id")
- @ExcludeMissing
- transactionId: JsonField = JsonMissing.of(),
- ) : this(acceptedAt, cardDisputeId, transactionId, mutableMapOf())
-
- /**
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Card
- * Dispute was accepted.
- *
- * @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 acceptedAt(): OffsetDateTime = acceptedAt.getRequired("accepted_at")
-
- /**
- * The identifier of the Card Dispute that was accepted.
- *
- * @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 cardDisputeId(): String = cardDisputeId.getRequired("card_dispute_id")
-
- /**
- * The identifier of the Transaction that was created to return the disputed funds to your
- * account.
- *
- * @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 transactionId(): String = transactionId.getRequired("transaction_id")
-
- /**
- * Returns the raw JSON value of [acceptedAt].
- *
- * Unlike [acceptedAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("accepted_at")
- @ExcludeMissing
- fun _acceptedAt(): JsonField = acceptedAt
-
- /**
- * Returns the raw JSON value of [cardDisputeId].
- *
- * Unlike [cardDisputeId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("card_dispute_id")
- @ExcludeMissing
- fun _cardDisputeId(): JsonField = cardDisputeId
-
- /**
- * Returns the raw JSON value of [transactionId].
- *
- * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("transaction_id")
- @ExcludeMissing
- fun _transactionId(): JsonField = transactionId
-
- @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 [Acceptance].
- *
- * The following fields are required:
- * ```java
- * .acceptedAt()
- * .cardDisputeId()
- * .transactionId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Acceptance]. */
- class Builder internal constructor() {
-
- private var acceptedAt: JsonField? = null
- private var cardDisputeId: JsonField? = null
- private var transactionId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(acceptance: Acceptance) = apply {
- acceptedAt = acceptance.acceptedAt
- cardDisputeId = acceptance.cardDisputeId
- transactionId = acceptance.transactionId
- additionalProperties = acceptance.additionalProperties.toMutableMap()
- }
-
- /**
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
- * Card Dispute was accepted.
- */
- fun acceptedAt(acceptedAt: OffsetDateTime) = acceptedAt(JsonField.of(acceptedAt))
-
- /**
- * Sets [Builder.acceptedAt] to an arbitrary JSON value.
- *
- * You should usually call [Builder.acceptedAt] with a well-typed [OffsetDateTime] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun acceptedAt(acceptedAt: JsonField) = apply {
- this.acceptedAt = acceptedAt
- }
-
- /** The identifier of the Card Dispute that was accepted. */
- fun cardDisputeId(cardDisputeId: String) = cardDisputeId(JsonField.of(cardDisputeId))
-
- /**
- * Sets [Builder.cardDisputeId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.cardDisputeId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun cardDisputeId(cardDisputeId: JsonField) = apply {
- this.cardDisputeId = cardDisputeId
- }
-
- /**
- * The identifier of the Transaction that was created to return the disputed funds to
- * your account.
- */
- fun transactionId(transactionId: String) = transactionId(JsonField.of(transactionId))
-
- /**
- * Sets [Builder.transactionId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.transactionId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun transactionId(transactionId: JsonField) = apply {
- this.transactionId = transactionId
- }
-
- 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 [Acceptance].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .acceptedAt()
- * .cardDisputeId()
- * .transactionId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Acceptance =
- Acceptance(
- checkRequired("acceptedAt", acceptedAt),
- checkRequired("cardDisputeId", cardDisputeId),
- checkRequired("transactionId", transactionId),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Acceptance = apply {
- if (validated) {
- return@apply
- }
-
- acceptedAt()
- cardDisputeId()
- transactionId()
- 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 (acceptedAt.asKnown().isPresent) 1 else 0) +
- (if (cardDisputeId.asKnown().isPresent) 1 else 0) +
- (if (transactionId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Acceptance &&
- acceptedAt == other.acceptedAt &&
- cardDisputeId == other.cardDisputeId &&
- transactionId == other.transactionId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(acceptedAt, cardDisputeId, transactionId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Acceptance{acceptedAt=$acceptedAt, cardDisputeId=$cardDisputeId, transactionId=$transactionId, additionalProperties=$additionalProperties}"
- }
-
- /** If the Card Dispute's status is `lost`, this will contain details of the lost dispute. */
- class Loss
- private constructor(
- private val cardDisputeId: JsonField,
- private val explanation: JsonField,
- private val lostAt: JsonField,
- private val transactionId: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("card_dispute_id")
- @ExcludeMissing
- cardDisputeId: JsonField = JsonMissing.of(),
- @JsonProperty("explanation")
- @ExcludeMissing
- explanation: JsonField = JsonMissing.of(),
- @JsonProperty("lost_at")
- @ExcludeMissing
- lostAt: JsonField = JsonMissing.of(),
- @JsonProperty("transaction_id")
- @ExcludeMissing
- transactionId: JsonField = JsonMissing.of(),
- ) : this(cardDisputeId, explanation, lostAt, transactionId, mutableMapOf())
-
- /**
- * The identifier of the Card Dispute that 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 cardDisputeId(): String = cardDisputeId.getRequired("card_dispute_id")
-
- /**
- * Why 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 explanation(): String = explanation.getRequired("explanation")
-
- /**
- * 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 identifier of the Transaction that was created to debit the disputed funds from your
- * account.
- *
- * @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 transactionId(): String = transactionId.getRequired("transaction_id")
-
- /**
- * Returns the raw JSON value of [cardDisputeId].
- *
- * Unlike [cardDisputeId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("card_dispute_id")
- @ExcludeMissing
- fun _cardDisputeId(): JsonField = cardDisputeId
-
- /**
- * Returns the raw JSON value of [explanation].
- *
- * Unlike [explanation], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("explanation")
- @ExcludeMissing
- fun _explanation(): JsonField = explanation
-
- /**
- * 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 [transactionId].
- *
- * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("transaction_id")
- @ExcludeMissing
- fun _transactionId(): JsonField = transactionId
-
- @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
- * .cardDisputeId()
- * .explanation()
- * .lostAt()
- * .transactionId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Loss]. */
- class Builder internal constructor() {
-
- private var cardDisputeId: JsonField? = null
- private var explanation: JsonField? = null
- private var lostAt: JsonField? = null
- private var transactionId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(loss: Loss) = apply {
- cardDisputeId = loss.cardDisputeId
- explanation = loss.explanation
- lostAt = loss.lostAt
- transactionId = loss.transactionId
- additionalProperties = loss.additionalProperties.toMutableMap()
- }
-
- /** The identifier of the Card Dispute that was lost. */
- fun cardDisputeId(cardDisputeId: String) = cardDisputeId(JsonField.of(cardDisputeId))
-
- /**
- * Sets [Builder.cardDisputeId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.cardDisputeId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun cardDisputeId(cardDisputeId: JsonField) = apply {
- this.cardDisputeId = cardDisputeId
- }
-
- /** Why the Card Dispute was lost. */
- fun explanation(explanation: String) = explanation(JsonField.of(explanation))
-
- /**
- * Sets [Builder.explanation] to an arbitrary JSON value.
- *
- * You should usually call [Builder.explanation] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun explanation(explanation: JsonField) = apply {
- this.explanation = explanation
- }
-
- /**
- * 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 identifier of the Transaction that was created to debit the disputed funds from
- * your account.
- */
- fun transactionId(transactionId: String) = transactionId(JsonField.of(transactionId))
-
- /**
- * Sets [Builder.transactionId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.transactionId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun transactionId(transactionId: JsonField) = apply {
- this.transactionId = transactionId
- }
-
- 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
- * .cardDisputeId()
- * .explanation()
- * .lostAt()
- * .transactionId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Loss =
- Loss(
- checkRequired("cardDisputeId", cardDisputeId),
- checkRequired("explanation", explanation),
- checkRequired("lostAt", lostAt),
- checkRequired("transactionId", transactionId),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Loss = apply {
- if (validated) {
- return@apply
- }
-
- cardDisputeId()
- explanation()
- lostAt()
- transactionId()
- 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 (cardDisputeId.asKnown().isPresent) 1 else 0) +
- (if (explanation.asKnown().isPresent) 1 else 0) +
- (if (lostAt.asKnown().isPresent) 1 else 0) +
- (if (transactionId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Loss &&
- cardDisputeId == other.cardDisputeId &&
- explanation == other.explanation &&
- lostAt == other.lostAt &&
- transactionId == other.transactionId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(cardDisputeId, explanation, lostAt, transactionId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Loss{cardDisputeId=$cardDisputeId, explanation=$explanation, lostAt=$lostAt, transactionId=$transactionId, additionalProperties=$additionalProperties}"
- }
-
- /**
- * If the Card Dispute's status is `rejected`, this will contain details of the unsuccessful
- * dispute.
- */
- class Rejection
- private constructor(
- private val cardDisputeId: JsonField,
- private val explanation: JsonField,
- private val rejectedAt: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("card_dispute_id")
- @ExcludeMissing
- cardDisputeId: JsonField = JsonMissing.of(),
- @JsonProperty("explanation")
- @ExcludeMissing
- explanation: JsonField = JsonMissing.of(),
- @JsonProperty("rejected_at")
- @ExcludeMissing
- rejectedAt: JsonField = JsonMissing.of(),
- ) : this(cardDisputeId, explanation, rejectedAt, mutableMapOf())
-
- /**
- * The identifier of the Card Dispute that was rejected.
- *
- * @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 cardDisputeId(): String = cardDisputeId.getRequired("card_dispute_id")
-
- /**
- * Why the Card Dispute was rejected.
- *
- * @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 explanation(): String = explanation.getRequired("explanation")
-
- /**
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Card
- * Dispute was rejected.
- *
- * @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 rejectedAt(): OffsetDateTime = rejectedAt.getRequired("rejected_at")
-
- /**
- * Returns the raw JSON value of [cardDisputeId].
- *
- * Unlike [cardDisputeId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("card_dispute_id")
- @ExcludeMissing
- fun _cardDisputeId(): JsonField = cardDisputeId
-
- /**
- * Returns the raw JSON value of [explanation].
- *
- * Unlike [explanation], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("explanation")
- @ExcludeMissing
- fun _explanation(): JsonField = explanation
-
- /**
- * Returns the raw JSON value of [rejectedAt].
- *
- * Unlike [rejectedAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("rejected_at")
- @ExcludeMissing
- fun _rejectedAt(): JsonField = rejectedAt
-
- @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 [Rejection].
- *
- * The following fields are required:
- * ```java
- * .cardDisputeId()
- * .explanation()
- * .rejectedAt()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Rejection]. */
- class Builder internal constructor() {
-
- private var cardDisputeId: JsonField? = null
- private var explanation: JsonField? = null
- private var rejectedAt: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(rejection: Rejection) = apply {
- cardDisputeId = rejection.cardDisputeId
- explanation = rejection.explanation
- rejectedAt = rejection.rejectedAt
- additionalProperties = rejection.additionalProperties.toMutableMap()
- }
-
- /** The identifier of the Card Dispute that was rejected. */
- fun cardDisputeId(cardDisputeId: String) = cardDisputeId(JsonField.of(cardDisputeId))
-
- /**
- * Sets [Builder.cardDisputeId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.cardDisputeId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun cardDisputeId(cardDisputeId: JsonField) = apply {
- this.cardDisputeId = cardDisputeId
- }
-
- /** Why the Card Dispute was rejected. */
- fun explanation(explanation: String) = explanation(JsonField.of(explanation))
-
- /**
- * Sets [Builder.explanation] to an arbitrary JSON value.
- *
- * You should usually call [Builder.explanation] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun explanation(explanation: JsonField) = apply {
- this.explanation = explanation
- }
-
- /**
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
- * Card Dispute was rejected.
- */
- fun rejectedAt(rejectedAt: OffsetDateTime) = rejectedAt(JsonField.of(rejectedAt))
-
- /**
- * Sets [Builder.rejectedAt] to an arbitrary JSON value.
- *
- * You should usually call [Builder.rejectedAt] with a well-typed [OffsetDateTime] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun rejectedAt(rejectedAt: JsonField) = apply {
- this.rejectedAt = rejectedAt
- }
-
- 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 [Rejection].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .cardDisputeId()
- * .explanation()
- * .rejectedAt()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Rejection =
- Rejection(
- checkRequired("cardDisputeId", cardDisputeId),
- checkRequired("explanation", explanation),
- checkRequired("rejectedAt", rejectedAt),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Rejection = apply {
- if (validated) {
- return@apply
- }
-
- cardDisputeId()
- explanation()
- rejectedAt()
- 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 (cardDisputeId.asKnown().isPresent) 1 else 0) +
- (if (explanation.asKnown().isPresent) 1 else 0) +
- (if (rejectedAt.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Rejection &&
- cardDisputeId == other.cardDisputeId &&
- explanation == other.explanation &&
- rejectedAt == other.rejectedAt &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(cardDisputeId, explanation, rejectedAt, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Rejection{cardDisputeId=$cardDisputeId, explanation=$explanation, rejectedAt=$rejectedAt, additionalProperties=$additionalProperties}"
- }
-
- /** The results of the Dispute investigation. */
- 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 {
-
- /** The Card Dispute is pending review. */
- @JvmField val PENDING_REVIEWING = of("pending_reviewing")
-
- /** Increase has requested more information related to the Card Dispute from you. */
- @JvmField val PENDING_USER_INFORMATION = of("pending_user_information")
-
- /**
- * The Card Dispute has been accepted and your funds have been returned. The card
- * dispute will eventually transition into `won` or `lost` depending on the outcome.
- */
- @JvmField val ACCEPTED = of("accepted")
-
- /** The Card Dispute has been rejected. */
- @JvmField val REJECTED = of("rejected")
-
- /**
- * 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 {
- /** The Card Dispute is pending review. */
- PENDING_REVIEWING,
- /** Increase has requested more information related to the Card Dispute from you. */
- PENDING_USER_INFORMATION,
- /**
- * The Card Dispute has been accepted and your funds have been returned. The card
- * dispute will eventually transition into `won` or `lost` depending on the outcome.
- */
- ACCEPTED,
- /** The Card Dispute has been rejected. */
- REJECTED,
- /**
- * 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 {
- /** The Card Dispute is pending review. */
- PENDING_REVIEWING,
- /** Increase has requested more information related to the Card Dispute from you. */
- PENDING_USER_INFORMATION,
- /**
- * The Card Dispute has been accepted and your funds have been returned. The card
- * dispute will eventually transition into `won` or `lost` depending on the outcome.
- */
- ACCEPTED,
- /** The Card Dispute has been rejected. */
- REJECTED,
- /**
- * 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) {
- PENDING_REVIEWING -> Value.PENDING_REVIEWING
- PENDING_USER_INFORMATION -> Value.PENDING_USER_INFORMATION
- ACCEPTED -> Value.ACCEPTED
- REJECTED -> Value.REJECTED
- 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) {
- PENDING_REVIEWING -> Known.PENDING_REVIEWING
- PENDING_USER_INFORMATION -> Known.PENDING_USER_INFORMATION
- ACCEPTED -> Known.ACCEPTED
- REJECTED -> Known.REJECTED
- 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()
- }
-
- /** If the Card Dispute's status is `won`, this will contain details of the won dispute. */
- class Win
- private constructor(
- private val cardDisputeId: JsonField,
- private val wonAt: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("card_dispute_id")
- @ExcludeMissing
- cardDisputeId: JsonField = JsonMissing.of(),
- @JsonProperty("won_at")
- @ExcludeMissing
- wonAt: JsonField = JsonMissing.of(),
- ) : this(cardDisputeId, wonAt, mutableMapOf())
-
- /**
- * The identifier of the Card Dispute that was won.
- *
- * @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 cardDisputeId(): String = cardDisputeId.getRequired("card_dispute_id")
-
- /**
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the Card
- * Dispute was won.
- *
- * @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 wonAt(): OffsetDateTime = wonAt.getRequired("won_at")
-
- /**
- * Returns the raw JSON value of [cardDisputeId].
- *
- * Unlike [cardDisputeId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("card_dispute_id")
- @ExcludeMissing
- fun _cardDisputeId(): JsonField = cardDisputeId
-
- /**
- * Returns the raw JSON value of [wonAt].
- *
- * Unlike [wonAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("won_at") @ExcludeMissing fun _wonAt(): JsonField = wonAt
-
- @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 [Win].
- *
- * The following fields are required:
- * ```java
- * .cardDisputeId()
- * .wonAt()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Win]. */
- class Builder internal constructor() {
-
- private var cardDisputeId: JsonField? = null
- private var wonAt: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(win: Win) = apply {
- cardDisputeId = win.cardDisputeId
- wonAt = win.wonAt
- additionalProperties = win.additionalProperties.toMutableMap()
- }
-
- /** The identifier of the Card Dispute that was won. */
- fun cardDisputeId(cardDisputeId: String) = cardDisputeId(JsonField.of(cardDisputeId))
-
- /**
- * Sets [Builder.cardDisputeId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.cardDisputeId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun cardDisputeId(cardDisputeId: JsonField) = apply {
- this.cardDisputeId = cardDisputeId
- }
-
- /**
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
- * Card Dispute was won.
- */
- fun wonAt(wonAt: OffsetDateTime) = wonAt(JsonField.of(wonAt))
-
- /**
- * Sets [Builder.wonAt] to an arbitrary JSON value.
- *
- * You should usually call [Builder.wonAt] with a well-typed [OffsetDateTime] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun wonAt(wonAt: JsonField) = apply { this.wonAt = wonAt }
-
- 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 [Win].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .cardDisputeId()
- * .wonAt()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Win =
- Win(
- checkRequired("cardDisputeId", cardDisputeId),
- checkRequired("wonAt", wonAt),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Win = apply {
- if (validated) {
- return@apply
- }
-
- cardDisputeId()
- wonAt()
- 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 (cardDisputeId.asKnown().isPresent) 1 else 0) +
- (if (wonAt.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Win &&
- cardDisputeId == other.cardDisputeId &&
- wonAt == other.wonAt &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(cardDisputeId, wonAt, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Win{cardDisputeId=$cardDisputeId, wonAt=$wonAt, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is CardDispute &&
- id == other.id &&
- acceptance == other.acceptance &&
- amount == other.amount &&
- createdAt == other.createdAt &&
- disputedTransactionId == other.disputedTransactionId &&
- explanation == other.explanation &&
- idempotencyKey == other.idempotencyKey &&
- loss == other.loss &&
- rejection == other.rejection &&
- status == other.status &&
- type == other.type &&
- win == other.win &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(
- id,
- acceptance,
- amount,
- createdAt,
- disputedTransactionId,
- explanation,
- idempotencyKey,
- loss,
- rejection,
- status,
- type,
- win,
- additionalProperties,
- )
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "CardDispute{id=$id, acceptance=$acceptance, amount=$amount, createdAt=$createdAt, disputedTransactionId=$disputedTransactionId, explanation=$explanation, idempotencyKey=$idempotencyKey, loss=$loss, rejection=$rejection, status=$status, type=$type, win=$win, additionalProperties=$additionalProperties}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt
deleted file mode 100644
index a6625be86..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt
+++ /dev/null
@@ -1,592 +0,0 @@
-// 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.ExcludeMissing
-import com.increase.api.core.JsonField
-import com.increase.api.core.JsonMissing
-import com.increase.api.core.JsonValue
-import com.increase.api.core.Params
-import com.increase.api.core.checkRequired
-import com.increase.api.core.http.Headers
-import com.increase.api.core.http.QueryParams
-import com.increase.api.errors.IncreaseInvalidDataException
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-
-/** Create a Card Dispute */
-class CardDisputeCreateParams
-private constructor(
- private val body: Body,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /**
- * The Transaction you wish to dispute. This Transaction must have a `source_type` of
- * `card_settlement`.
- *
- * @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 = body.disputedTransactionId()
-
- /**
- * Why you are disputing this Transaction.
- *
- * @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 explanation(): String = body.explanation()
-
- /**
- * The monetary amount of the part of the transaction that is being disputed. This is optional
- * and will default to the full amount of the transaction if not provided. If provided, the
- * amount must be less than or equal to the amount of the transaction.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun amount(): Optional = body.amount()
-
- /**
- * Returns the raw JSON value of [disputedTransactionId].
- *
- * Unlike [disputedTransactionId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- fun _disputedTransactionId(): JsonField = body._disputedTransactionId()
-
- /**
- * Returns the raw JSON value of [explanation].
- *
- * Unlike [explanation], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _explanation(): JsonField = body._explanation()
-
- /**
- * Returns the raw JSON value of [amount].
- *
- * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _amount(): JsonField = body._amount()
-
- fun _additionalBodyProperties(): Map = body._additionalProperties()
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [CardDisputeCreateParams].
- *
- * The following fields are required:
- * ```java
- * .disputedTransactionId()
- * .explanation()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [CardDisputeCreateParams]. */
- class Builder internal constructor() {
-
- private var body: Body.Builder = Body.builder()
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(cardDisputeCreateParams: CardDisputeCreateParams) = apply {
- body = cardDisputeCreateParams.body.toBuilder()
- additionalHeaders = cardDisputeCreateParams.additionalHeaders.toBuilder()
- additionalQueryParams = cardDisputeCreateParams.additionalQueryParams.toBuilder()
- }
-
- /**
- * Sets the entire request body.
- *
- * This is generally only useful if you are already constructing the body separately.
- * Otherwise, it's more convenient to use the top-level setters instead:
- * - [disputedTransactionId]
- * - [explanation]
- * - [amount]
- */
- fun body(body: Body) = apply { this.body = body.toBuilder() }
-
- /**
- * The Transaction you wish to dispute. This Transaction must have a `source_type` of
- * `card_settlement`.
- */
- fun disputedTransactionId(disputedTransactionId: String) = apply {
- body.disputedTransactionId(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 {
- body.disputedTransactionId(disputedTransactionId)
- }
-
- /** Why you are disputing this Transaction. */
- fun explanation(explanation: String) = apply { body.explanation(explanation) }
-
- /**
- * Sets [Builder.explanation] to an arbitrary JSON value.
- *
- * You should usually call [Builder.explanation] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun explanation(explanation: JsonField) = apply { body.explanation(explanation) }
-
- /**
- * The monetary amount of the part of the transaction that is being disputed. This is
- * optional and will default to the full amount of the transaction if not provided. If
- * provided, the amount must be less than or equal to the amount of the transaction.
- */
- fun amount(amount: Long) = apply { body.amount(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 { body.amount(amount) }
-
- fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
- body.additionalProperties(additionalBodyProperties)
- }
-
- fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
- body.putAdditionalProperty(key, value)
- }
-
- fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
- apply {
- body.putAllAdditionalProperties(additionalBodyProperties)
- }
-
- fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
-
- fun removeAllAdditionalBodyProperties(keys: Set) = apply {
- body.removeAllAdditionalProperties(keys)
- }
-
- fun additionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun additionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun putAdditionalHeader(name: String, value: String) = apply {
- additionalHeaders.put(name, value)
- }
-
- fun putAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.put(name, values)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun replaceAdditionalHeaders(name: String, value: String) = apply {
- additionalHeaders.replace(name, value)
- }
-
- fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.replace(name, values)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
-
- fun removeAllAdditionalHeaders(names: Set) = apply {
- additionalHeaders.removeAll(names)
- }
-
- fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun additionalQueryParams(additionalQueryParams: Map>) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun putAdditionalQueryParam(key: String, value: String) = apply {
- additionalQueryParams.put(key, value)
- }
-
- fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.put(key, values)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun replaceAdditionalQueryParams(key: String, value: String) = apply {
- additionalQueryParams.replace(key, value)
- }
-
- fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.replace(key, values)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
-
- fun removeAllAdditionalQueryParams(keys: Set) = apply {
- additionalQueryParams.removeAll(keys)
- }
-
- /**
- * Returns an immutable instance of [CardDisputeCreateParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .disputedTransactionId()
- * .explanation()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): CardDisputeCreateParams =
- CardDisputeCreateParams(
- body.build(),
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- fun _body(): Body = body
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams = additionalQueryParams
-
- class Body
- private constructor(
- private val disputedTransactionId: JsonField,
- private val explanation: JsonField,
- private val amount: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("disputed_transaction_id")
- @ExcludeMissing
- disputedTransactionId: JsonField = JsonMissing.of(),
- @JsonProperty("explanation")
- @ExcludeMissing
- explanation: JsonField = JsonMissing.of(),
- @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
- ) : this(disputedTransactionId, explanation, amount, mutableMapOf())
-
- /**
- * The Transaction you wish to dispute. This Transaction must have a `source_type` of
- * `card_settlement`.
- *
- * @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")
-
- /**
- * Why you are disputing this Transaction.
- *
- * @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 explanation(): String = explanation.getRequired("explanation")
-
- /**
- * The monetary amount of the part of the transaction that is being disputed. This is
- * optional and will default to the full amount of the transaction if not provided. If
- * provided, the amount must be less than or equal to the amount of the transaction.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun amount(): Optional = amount.getOptional("amount")
-
- /**
- * 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 [explanation].
- *
- * Unlike [explanation], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("explanation")
- @ExcludeMissing
- fun _explanation(): JsonField = explanation
-
- /**
- * 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
-
- @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 [Body].
- *
- * The following fields are required:
- * ```java
- * .disputedTransactionId()
- * .explanation()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Body]. */
- class Builder internal constructor() {
-
- private var disputedTransactionId: JsonField? = null
- private var explanation: JsonField? = null
- private var amount: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(body: Body) = apply {
- disputedTransactionId = body.disputedTransactionId
- explanation = body.explanation
- amount = body.amount
- additionalProperties = body.additionalProperties.toMutableMap()
- }
-
- /**
- * The Transaction you wish to dispute. This Transaction must have a `source_type` of
- * `card_settlement`.
- */
- 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
- }
-
- /** Why you are disputing this Transaction. */
- fun explanation(explanation: String) = explanation(JsonField.of(explanation))
-
- /**
- * Sets [Builder.explanation] to an arbitrary JSON value.
- *
- * You should usually call [Builder.explanation] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun explanation(explanation: JsonField) = apply {
- this.explanation = explanation
- }
-
- /**
- * The monetary amount of the part of the transaction that is being disputed. This is
- * optional and will default to the full amount of the transaction if not provided. If
- * provided, the amount must be less than or equal to the amount of the transaction.
- */
- 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 }
-
- 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 [Body].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .disputedTransactionId()
- * .explanation()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Body =
- Body(
- checkRequired("disputedTransactionId", disputedTransactionId),
- checkRequired("explanation", explanation),
- amount,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Body = apply {
- if (validated) {
- return@apply
- }
-
- disputedTransactionId()
- explanation()
- amount()
- 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 (disputedTransactionId.asKnown().isPresent) 1 else 0) +
- (if (explanation.asKnown().isPresent) 1 else 0) +
- (if (amount.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Body &&
- disputedTransactionId == other.disputedTransactionId &&
- explanation == other.explanation &&
- amount == other.amount &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(disputedTransactionId, explanation, amount, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Body{disputedTransactionId=$disputedTransactionId, explanation=$explanation, amount=$amount, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is CardDisputeCreateParams &&
- body == other.body &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "CardDisputeCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPage.kt
deleted file mode 100644
index abea17ee5..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPage.kt
+++ /dev/null
@@ -1,132 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.carddisputes
-
-import com.increase.api.core.AutoPager
-import com.increase.api.core.Page
-import com.increase.api.core.checkRequired
-import com.increase.api.services.blocking.CardDisputeService
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** @see CardDisputeService.list */
-class CardDisputeListPage
-private constructor(
- private val service: CardDisputeService,
- private val params: CardDisputeListParams,
- private val response: CardDisputeListPageResponse,
-) : Page {
-
- /**
- * Delegates to [CardDisputeListPageResponse], but gracefully handles missing data.
- *
- * @see CardDisputeListPageResponse.data
- */
- fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList()
-
- /**
- * Delegates to [CardDisputeListPageResponse], but gracefully handles missing data.
- *
- * @see CardDisputeListPageResponse.nextCursor
- */
- fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor")
-
- override fun items(): List = data()
-
- override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent
-
- fun nextPageParams(): CardDisputeListParams {
- val nextCursor =
- nextCursor().getOrNull()
- ?: throw IllegalStateException("Cannot construct next page params")
- return params.toBuilder().cursor(nextCursor).build()
- }
-
- override fun nextPage(): CardDisputeListPage = service.list(nextPageParams())
-
- fun autoPager(): AutoPager = AutoPager.from(this)
-
- /** The parameters that were used to request this page. */
- fun params(): CardDisputeListParams = params
-
- /** The response that this page was parsed from. */
- fun response(): CardDisputeListPageResponse = response
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [CardDisputeListPage].
- *
- * The following fields are required:
- * ```java
- * .service()
- * .params()
- * .response()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [CardDisputeListPage]. */
- class Builder internal constructor() {
-
- private var service: CardDisputeService? = null
- private var params: CardDisputeListParams? = null
- private var response: CardDisputeListPageResponse? = null
-
- @JvmSynthetic
- internal fun from(cardDisputeListPage: CardDisputeListPage) = apply {
- service = cardDisputeListPage.service
- params = cardDisputeListPage.params
- response = cardDisputeListPage.response
- }
-
- fun service(service: CardDisputeService) = apply { this.service = service }
-
- /** The parameters that were used to request this page. */
- fun params(params: CardDisputeListParams) = apply { this.params = params }
-
- /** The response that this page was parsed from. */
- fun response(response: CardDisputeListPageResponse) = apply { this.response = response }
-
- /**
- * Returns an immutable instance of [CardDisputeListPage].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .service()
- * .params()
- * .response()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): CardDisputeListPage =
- CardDisputeListPage(
- checkRequired("service", service),
- checkRequired("params", params),
- checkRequired("response", response),
- )
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is CardDisputeListPage &&
- service == other.service &&
- params == other.params &&
- response == other.response
- }
-
- override fun hashCode(): Int = Objects.hash(service, params, response)
-
- override fun toString() =
- "CardDisputeListPage{service=$service, params=$params, response=$response}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageAsync.kt
deleted file mode 100644
index a7c681639..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageAsync.kt
+++ /dev/null
@@ -1,146 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.carddisputes
-
-import com.increase.api.core.AutoPagerAsync
-import com.increase.api.core.PageAsync
-import com.increase.api.core.checkRequired
-import com.increase.api.services.async.CardDisputeServiceAsync
-import java.util.Objects
-import java.util.Optional
-import java.util.concurrent.CompletableFuture
-import java.util.concurrent.Executor
-import kotlin.jvm.optionals.getOrNull
-
-/** @see CardDisputeServiceAsync.list */
-class CardDisputeListPageAsync
-private constructor(
- private val service: CardDisputeServiceAsync,
- private val streamHandlerExecutor: Executor,
- private val params: CardDisputeListParams,
- private val response: CardDisputeListPageResponse,
-) : PageAsync {
-
- /**
- * Delegates to [CardDisputeListPageResponse], but gracefully handles missing data.
- *
- * @see CardDisputeListPageResponse.data
- */
- fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList()
-
- /**
- * Delegates to [CardDisputeListPageResponse], but gracefully handles missing data.
- *
- * @see CardDisputeListPageResponse.nextCursor
- */
- fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor")
-
- override fun items(): List = data()
-
- override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent
-
- fun nextPageParams(): CardDisputeListParams {
- val nextCursor =
- nextCursor().getOrNull()
- ?: throw IllegalStateException("Cannot construct next page params")
- return params.toBuilder().cursor(nextCursor).build()
- }
-
- override fun nextPage(): CompletableFuture =
- service.list(nextPageParams())
-
- fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor)
-
- /** The parameters that were used to request this page. */
- fun params(): CardDisputeListParams = params
-
- /** The response that this page was parsed from. */
- fun response(): CardDisputeListPageResponse = response
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [CardDisputeListPageAsync].
- *
- * The following fields are required:
- * ```java
- * .service()
- * .streamHandlerExecutor()
- * .params()
- * .response()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [CardDisputeListPageAsync]. */
- class Builder internal constructor() {
-
- private var service: CardDisputeServiceAsync? = null
- private var streamHandlerExecutor: Executor? = null
- private var params: CardDisputeListParams? = null
- private var response: CardDisputeListPageResponse? = null
-
- @JvmSynthetic
- internal fun from(cardDisputeListPageAsync: CardDisputeListPageAsync) = apply {
- service = cardDisputeListPageAsync.service
- streamHandlerExecutor = cardDisputeListPageAsync.streamHandlerExecutor
- params = cardDisputeListPageAsync.params
- response = cardDisputeListPageAsync.response
- }
-
- fun service(service: CardDisputeServiceAsync) = apply { this.service = service }
-
- fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
- this.streamHandlerExecutor = streamHandlerExecutor
- }
-
- /** The parameters that were used to request this page. */
- fun params(params: CardDisputeListParams) = apply { this.params = params }
-
- /** The response that this page was parsed from. */
- fun response(response: CardDisputeListPageResponse) = apply { this.response = response }
-
- /**
- * Returns an immutable instance of [CardDisputeListPageAsync].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .service()
- * .streamHandlerExecutor()
- * .params()
- * .response()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): CardDisputeListPageAsync =
- CardDisputeListPageAsync(
- checkRequired("service", service),
- checkRequired("streamHandlerExecutor", streamHandlerExecutor),
- checkRequired("params", params),
- checkRequired("response", response),
- )
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is CardDisputeListPageAsync &&
- service == other.service &&
- streamHandlerExecutor == other.streamHandlerExecutor &&
- params == other.params &&
- response == other.response
- }
-
- override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response)
-
- override fun toString() =
- "CardDisputeListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponse.kt
deleted file mode 100644
index 7e3106976..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponse.kt
+++ /dev/null
@@ -1,236 +0,0 @@
-// 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.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.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** A list of Card Dispute objects. */
-class CardDisputeListPageResponse
-private constructor(
- private val data: JsonField>,
- private val nextCursor: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("data") @ExcludeMissing data: JsonField> = JsonMissing.of(),
- @JsonProperty("next_cursor")
- @ExcludeMissing
- nextCursor: JsonField = JsonMissing.of(),
- ) : this(data, nextCursor, mutableMapOf())
-
- /**
- * The contents of the list.
- *
- * @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 data(): List = data.getRequired("data")
-
- /**
- * A pointer to a place in the list.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun nextCursor(): Optional = nextCursor.getOptional("next_cursor")
-
- /**
- * Returns the raw JSON value of [data].
- *
- * Unlike [data], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data
-
- /**
- * Returns the raw JSON value of [nextCursor].
- *
- * Unlike [nextCursor], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("next_cursor") @ExcludeMissing fun _nextCursor(): JsonField = nextCursor
-
- @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 [CardDisputeListPageResponse].
- *
- * The following fields are required:
- * ```java
- * .data()
- * .nextCursor()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [CardDisputeListPageResponse]. */
- class Builder internal constructor() {
-
- private var data: JsonField>? = null
- private var nextCursor: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(cardDisputeListPageResponse: CardDisputeListPageResponse) = apply {
- data = cardDisputeListPageResponse.data.map { it.toMutableList() }
- nextCursor = cardDisputeListPageResponse.nextCursor
- additionalProperties = cardDisputeListPageResponse.additionalProperties.toMutableMap()
- }
-
- /** The contents of the list. */
- fun data(data: List) = data(JsonField.of(data))
-
- /**
- * Sets [Builder.data] to an arbitrary JSON value.
- *
- * You should usually call [Builder.data] with a well-typed `List` value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun data(data: JsonField>) = apply {
- this.data = data.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [CardDispute] to [Builder.data].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addData(data: CardDispute) = apply {
- this.data =
- (this.data ?: JsonField.of(mutableListOf())).also {
- checkKnown("data", it).add(data)
- }
- }
-
- /** A pointer to a place in the list. */
- fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor))
-
- /** Alias for calling [Builder.nextCursor] with `nextCursor.orElse(null)`. */
- fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull())
-
- /**
- * Sets [Builder.nextCursor] to an arbitrary JSON value.
- *
- * You should usually call [Builder.nextCursor] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor }
-
- 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 [CardDisputeListPageResponse].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .data()
- * .nextCursor()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): CardDisputeListPageResponse =
- CardDisputeListPageResponse(
- checkRequired("data", data).map { it.toImmutable() },
- checkRequired("nextCursor", nextCursor),
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): CardDisputeListPageResponse = apply {
- if (validated) {
- return@apply
- }
-
- data().forEach { it.validate() }
- nextCursor()
- 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 =
- (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
- (if (nextCursor.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is CardDisputeListPageResponse &&
- data == other.data &&
- nextCursor == other.nextCursor &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(data, nextCursor, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "CardDisputeListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}"
-}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListParams.kt
deleted file mode 100644
index 9f7962746..000000000
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListParams.kt
+++ /dev/null
@@ -1,807 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.increase.api.models.carddisputes
-
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.increase.api.core.Enum
-import com.increase.api.core.JsonField
-import com.increase.api.core.Params
-import com.increase.api.core.http.Headers
-import com.increase.api.core.http.QueryParams
-import com.increase.api.core.toImmutable
-import com.increase.api.errors.IncreaseInvalidDataException
-import java.time.OffsetDateTime
-import java.time.format.DateTimeFormatter
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** List Card Disputes */
-class CardDisputeListParams
-private constructor(
- private val createdAt: CreatedAt?,
- private val cursor: String?,
- private val idempotencyKey: String?,
- private val limit: Long?,
- private val status: Status?,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- fun createdAt(): Optional = Optional.ofNullable(createdAt)
-
- /** Return the page of entries after this one. */
- fun cursor(): Optional = Optional.ofNullable(cursor)
-
- /**
- * Filter records to the one with the specified `idempotency_key` you chose for that 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(): Optional = Optional.ofNullable(idempotencyKey)
-
- /** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */
- fun limit(): Optional = Optional.ofNullable(limit)
-
- fun status(): Optional = Optional.ofNullable(status)
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun none(): CardDisputeListParams = builder().build()
-
- /** Returns a mutable builder for constructing an instance of [CardDisputeListParams]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [CardDisputeListParams]. */
- class Builder internal constructor() {
-
- private var createdAt: CreatedAt? = null
- private var cursor: String? = null
- private var idempotencyKey: String? = null
- private var limit: Long? = null
- private var status: Status? = null
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(cardDisputeListParams: CardDisputeListParams) = apply {
- createdAt = cardDisputeListParams.createdAt
- cursor = cardDisputeListParams.cursor
- idempotencyKey = cardDisputeListParams.idempotencyKey
- limit = cardDisputeListParams.limit
- status = cardDisputeListParams.status
- additionalHeaders = cardDisputeListParams.additionalHeaders.toBuilder()
- additionalQueryParams = cardDisputeListParams.additionalQueryParams.toBuilder()
- }
-
- fun createdAt(createdAt: CreatedAt?) = apply { this.createdAt = createdAt }
-
- /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */
- fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull())
-
- /** Return the page of entries after this one. */
- fun cursor(cursor: String?) = apply { this.cursor = cursor }
-
- /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */
- fun cursor(cursor: Optional) = cursor(cursor.getOrNull())
-
- /**
- * Filter records to the one with the specified `idempotency_key` you chose for that 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?) = apply { this.idempotencyKey = idempotencyKey }
-
- /** Alias for calling [Builder.idempotencyKey] with `idempotencyKey.orElse(null)`. */
- fun idempotencyKey(idempotencyKey: Optional) =
- idempotencyKey(idempotencyKey.getOrNull())
-
- /**
- * Limit the size of the list that is returned. The default (and maximum) is 100 objects.
- */
- fun limit(limit: Long?) = apply { this.limit = limit }
-
- /**
- * Alias for [Builder.limit].
- *
- * This unboxed primitive overload exists for backwards compatibility.
- */
- fun limit(limit: Long) = limit(limit as Long?)
-
- /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */
- fun limit(limit: Optional) = limit(limit.getOrNull())
-
- fun status(status: Status?) = apply { this.status = status }
-
- /** Alias for calling [Builder.status] with `status.orElse(null)`. */
- fun status(status: Optional) = status(status.getOrNull())
-
- fun additionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun additionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun putAdditionalHeader(name: String, value: String) = apply {
- additionalHeaders.put(name, value)
- }
-
- fun putAdditionalHeaders(name: String, values: Iterable