diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5dc618705..f1d4e1531 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.272.0" + ".": "0.273.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 7168a74e1..a81891058 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 202 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-aceb2cce1f9a46b1059a04de979b4c40210190639a4c264944b4402042168804.yml -openapi_spec_hash: 5b4ea7615676e742cea44d107b8038ca +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-147712ba3a72b1dea9a966f9b0ebc99ccebe38e1789426115f3b4c8977ed03c8.yml +openapi_spec_hash: 6c6fc01c8ea4f34b3c2553928945c100 config_hash: a185e9a72778cc4658ea73fb3a7f1354 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bbc27836..878ce9258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.273.0 (2025-08-06) + +Full Changelog: [v0.272.0...v0.273.0](https://github.com/Increase/increase-java/compare/v0.272.0...v0.273.0) + +### Features + +* **api:** api update ([eb1b597](https://github.com/Increase/increase-java/commit/eb1b597349163ef5372f2a28a54607e3239e7953)) + + +### Chores + +* **example:** fix run example comment ([fee56bf](https://github.com/Increase/increase-java/commit/fee56bf02015b7e8ac6c8a1ad789138fc1897123)) +* **internal:** add async lock helper ([207a33b](https://github.com/Increase/increase-java/commit/207a33b115a9dce3b3132b9b1bc91b799462d2e6)) + ## 0.272.0 (2025-08-04) Full Changelog: [v0.271.0...v0.272.0](https://github.com/Increase/increase-java/compare/v0.271.0...v0.272.0) diff --git a/README.md b/README.md index 5ecb453fa..b31779f09 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.272.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.272.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.272.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.273.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.273.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.273.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.272.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.273.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.272.0") +implementation("com.increase.api:increase-java:0.273.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.272.0") com.increase.api increase-java - 0.272.0 + 0.273.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 34ff363bc..c8c339d4f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.272.0" // x-release-please-version + version = "0.273.0" // x-release-please-version } subprojects { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/core/Utils.kt b/increase-java-core/src/main/kotlin/com/increase/api/core/Utils.kt index 3603f4cf4..8383f240e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/core/Utils.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/core/Utils.kt @@ -6,6 +6,8 @@ import com.increase.api.core.http.Headers import com.increase.api.errors.IncreaseInvalidDataException import java.util.Collections import java.util.SortedMap +import java.util.concurrent.CompletableFuture +import java.util.concurrent.locks.Lock @JvmSynthetic internal fun T?.getOrThrow(name: String): T = @@ -95,3 +97,24 @@ internal fun Headers.getRequiredHeader(name: String): String = values(name).firstOrNull() ?: throw IncreaseInvalidDataException("Could not find $name header") internal interface Enum + +/** + * Executes the given [action] while holding the lock, returning a [CompletableFuture] with the + * result. + * + * @param action The asynchronous action to execute while holding the lock + * @return A [CompletableFuture] that completes with the result of the action + */ +@JvmSynthetic +internal fun Lock.withLockAsync(action: () -> CompletableFuture): CompletableFuture { + lock() + val future = + try { + action() + } catch (e: Throwable) { + unlock() + throw e + } + future.whenComplete { _, _ -> unlock() } + return future +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index ae9580b62..160bd69b8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -873,6 +873,7 @@ private constructor( private val achTransferRejection: JsonField, private val achTransferReturn: JsonField, private val cardDisputeAcceptance: JsonField, + private val cardDisputeFinancial: JsonField, private val cardDisputeLoss: JsonField, private val cardPushTransferAcceptance: JsonField, private val cardRefund: JsonField, @@ -924,6 +925,9 @@ private constructor( @JsonProperty("card_dispute_acceptance") @ExcludeMissing cardDisputeAcceptance: JsonField = JsonMissing.of(), + @JsonProperty("card_dispute_financial") + @ExcludeMissing + cardDisputeFinancial: JsonField = JsonMissing.of(), @JsonProperty("card_dispute_loss") @ExcludeMissing cardDisputeLoss: JsonField = JsonMissing.of(), @@ -1017,6 +1021,7 @@ private constructor( achTransferRejection, achTransferReturn, cardDisputeAcceptance, + cardDisputeFinancial, cardDisputeLoss, cardPushTransferAcceptance, cardRefund, @@ -1107,6 +1112,17 @@ private constructor( fun cardDisputeAcceptance(): Optional = cardDisputeAcceptance.getOptional("card_dispute_acceptance") + /** + * A Card Dispute Financial object. This field will be present in the JSON response if and + * only if `category` is equal to `card_dispute_financial`. Financial event related to a + * Card Dispute. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun cardDisputeFinancial(): Optional = + cardDisputeFinancial.getOptional("card_dispute_financial") + /** * A Card Dispute Loss object. This field will be present in the JSON response if and only * if `category` is equal to `card_dispute_loss`. Contains the details of a lost Card @@ -1474,6 +1490,16 @@ private constructor( @ExcludeMissing fun _cardDisputeAcceptance(): JsonField = cardDisputeAcceptance + /** + * Returns the raw JSON value of [cardDisputeFinancial]. + * + * Unlike [cardDisputeFinancial], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("card_dispute_financial") + @ExcludeMissing + fun _cardDisputeFinancial(): JsonField = cardDisputeFinancial + /** * Returns the raw JSON value of [cardDisputeLoss]. * @@ -1762,6 +1788,7 @@ private constructor( * .achTransferRejection() * .achTransferReturn() * .cardDisputeAcceptance() + * .cardDisputeFinancial() * .cardDisputeLoss() * .cardPushTransferAcceptance() * .cardRefund() @@ -1802,6 +1829,7 @@ private constructor( private var achTransferRejection: JsonField? = null private var achTransferReturn: JsonField? = null private var cardDisputeAcceptance: JsonField? = null + private var cardDisputeFinancial: JsonField? = null private var cardDisputeLoss: JsonField? = null private var cardPushTransferAcceptance: JsonField? = null private var cardRefund: JsonField? = null @@ -1848,6 +1876,7 @@ private constructor( achTransferRejection = source.achTransferRejection achTransferReturn = source.achTransferReturn cardDisputeAcceptance = source.cardDisputeAcceptance + cardDisputeFinancial = source.cardDisputeFinancial cardDisputeLoss = source.cardDisputeLoss cardPushTransferAcceptance = source.cardPushTransferAcceptance cardRefund = source.cardRefund @@ -2019,6 +2048,33 @@ private constructor( this.cardDisputeAcceptance = cardDisputeAcceptance } + /** + * A Card Dispute Financial object. This field will be present in the JSON response if + * and only if `category` is equal to `card_dispute_financial`. Financial event related + * to a Card Dispute. + */ + fun cardDisputeFinancial(cardDisputeFinancial: CardDisputeFinancial?) = + cardDisputeFinancial(JsonField.ofNullable(cardDisputeFinancial)) + + /** + * Alias for calling [Builder.cardDisputeFinancial] with + * `cardDisputeFinancial.orElse(null)`. + */ + fun cardDisputeFinancial(cardDisputeFinancial: Optional) = + cardDisputeFinancial(cardDisputeFinancial.getOrNull()) + + /** + * Sets [Builder.cardDisputeFinancial] to an arbitrary JSON value. + * + * You should usually call [Builder.cardDisputeFinancial] with a well-typed + * [CardDisputeFinancial] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun cardDisputeFinancial(cardDisputeFinancial: JsonField) = + apply { + this.cardDisputeFinancial = cardDisputeFinancial + } + /** * A Card Dispute Loss object. This field will be present in the JSON response if and * only if `category` is equal to `card_dispute_loss`. Contains the details of a lost @@ -2777,6 +2833,7 @@ private constructor( * .achTransferRejection() * .achTransferReturn() * .cardDisputeAcceptance() + * .cardDisputeFinancial() * .cardDisputeLoss() * .cardPushTransferAcceptance() * .cardRefund() @@ -2815,6 +2872,7 @@ private constructor( checkRequired("achTransferRejection", achTransferRejection), checkRequired("achTransferReturn", achTransferReturn), checkRequired("cardDisputeAcceptance", cardDisputeAcceptance), + checkRequired("cardDisputeFinancial", cardDisputeFinancial), checkRequired("cardDisputeLoss", cardDisputeLoss), checkRequired("cardPushTransferAcceptance", cardPushTransferAcceptance), checkRequired("cardRefund", cardRefund), @@ -2873,6 +2931,7 @@ private constructor( achTransferRejection().ifPresent { it.validate() } achTransferReturn().ifPresent { it.validate() } cardDisputeAcceptance().ifPresent { it.validate() } + cardDisputeFinancial().ifPresent { it.validate() } cardDisputeLoss().ifPresent { it.validate() } cardPushTransferAcceptance().ifPresent { it.validate() } cardRefund().ifPresent { it.validate() } @@ -2923,6 +2982,7 @@ private constructor( (achTransferRejection.asKnown().getOrNull()?.validity() ?: 0) + (achTransferReturn.asKnown().getOrNull()?.validity() ?: 0) + (cardDisputeAcceptance.asKnown().getOrNull()?.validity() ?: 0) + + (cardDisputeFinancial.asKnown().getOrNull()?.validity() ?: 0) + (cardDisputeLoss.asKnown().getOrNull()?.validity() ?: 0) + (cardPushTransferAcceptance.asKnown().getOrNull()?.validity() ?: 0) + (cardRefund.asKnown().getOrNull()?.validity() ?: 0) + @@ -6077,6 +6137,845 @@ private constructor( "CardDisputeAcceptance{acceptedAt=$acceptedAt, cardDisputeId=$cardDisputeId, transactionId=$transactionId, additionalProperties=$additionalProperties}" } + /** + * A Card Dispute Financial object. This field will be present in the JSON response if and + * only if `category` is equal to `card_dispute_financial`. Financial event related to a + * Card Dispute. + */ + class CardDisputeFinancial + private constructor( + private val amount: JsonField, + private val cardDisputeId: JsonField, + private val network: JsonField, + private val transactionId: JsonField, + private val visa: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("card_dispute_id") + @ExcludeMissing + cardDisputeId: JsonField = JsonMissing.of(), + @JsonProperty("network") + @ExcludeMissing + network: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), + ) : this(amount, cardDisputeId, network, transactionId, visa, mutableMapOf()) + + /** + * The amount of the financial event. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The identifier of the Card Dispute the financial event is associated with. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun cardDisputeId(): String = cardDisputeId.getRequired("card_dispute_id") + + /** + * The network that the Card Dispute is associated with. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun network(): Network = network.getRequired("network") + + /** + * The identifier of the Transaction that was created to credit or debit the disputed + * funds to or 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") + + /** + * Information for events related to card dispute for card payments processed over + * Visa's network. This field will be present in the JSON response if and only if + * `network` is equal to `visa`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun visa(): Optional = visa.getOptional("visa") + + /** + * 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 [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 [network]. + * + * Unlike [network], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("network") @ExcludeMissing fun _network(): JsonField = network + + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + /** + * Returns the raw JSON value of [visa]. + * + * Unlike [visa], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("visa") @ExcludeMissing fun _visa(): JsonField = visa + + @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 [CardDisputeFinancial]. + * + * The following fields are required: + * ```java + * .amount() + * .cardDisputeId() + * .network() + * .transactionId() + * .visa() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardDisputeFinancial]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var cardDisputeId: JsonField? = null + private var network: JsonField? = null + private var transactionId: JsonField? = null + private var visa: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cardDisputeFinancial: CardDisputeFinancial) = apply { + amount = cardDisputeFinancial.amount + cardDisputeId = cardDisputeFinancial.cardDisputeId + network = cardDisputeFinancial.network + transactionId = cardDisputeFinancial.transactionId + visa = cardDisputeFinancial.visa + additionalProperties = cardDisputeFinancial.additionalProperties.toMutableMap() + } + + /** The amount of the financial event. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** The identifier of the Card Dispute the financial event is associated with. */ + 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 network that the Card Dispute is associated with. */ + fun network(network: Network) = network(JsonField.of(network)) + + /** + * Sets [Builder.network] to an arbitrary JSON value. + * + * You should usually call [Builder.network] with a well-typed [Network] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun network(network: JsonField) = apply { this.network = network } + + /** + * The identifier of the Transaction that was created to credit or debit the + * disputed funds to or 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 + } + + /** + * Information for events related to card dispute for card payments processed over + * Visa's network. This field will be present in the JSON response if and only if + * `network` is equal to `visa`. + */ + fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) + + /** Alias for calling [Builder.visa] with `visa.orElse(null)`. */ + fun visa(visa: Optional) = visa(visa.getOrNull()) + + /** + * Sets [Builder.visa] to an arbitrary JSON value. + * + * You should usually call [Builder.visa] with a well-typed [Visa] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun visa(visa: JsonField) = apply { this.visa = visa } + + 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 [CardDisputeFinancial]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .cardDisputeId() + * .network() + * .transactionId() + * .visa() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardDisputeFinancial = + CardDisputeFinancial( + checkRequired("amount", amount), + checkRequired("cardDisputeId", cardDisputeId), + checkRequired("network", network), + checkRequired("transactionId", transactionId), + checkRequired("visa", visa), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardDisputeFinancial = apply { + if (validated) { + return@apply + } + + amount() + cardDisputeId() + network().validate() + transactionId() + visa().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 (amount.asKnown().isPresent) 1 else 0) + + (if (cardDisputeId.asKnown().isPresent) 1 else 0) + + (network.asKnown().getOrNull()?.validity() ?: 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + (visa.asKnown().getOrNull()?.validity() ?: 0) + + /** The network that the Card Dispute is associated with. */ + class Network @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** Visa: details will be under the `visa` object. */ + @JvmField val VISA = of("visa") + + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) + } + + /** An enum containing [Network]'s known values. */ + enum class Known { + /** Visa: details will be under the `visa` object. */ + VISA + } + + /** + * An enum containing [Network]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Network] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** Visa: details will be under the `visa` object. */ + VISA, + /** + * An enum member indicating that [Network] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + VISA -> Value.VISA + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + VISA -> Known.VISA + else -> throw IncreaseInvalidDataException("Unknown Network: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Network = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Network && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Information for events related to card dispute for card payments processed over + * Visa's network. This field will be present in the JSON response if and only if + * `network` is equal to `visa`. + */ + class Visa + private constructor( + private val eventType: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("event_type") + @ExcludeMissing + eventType: JsonField = JsonMissing.of() + ) : this(eventType, mutableMapOf()) + + /** + * The type of card dispute financial event. + * + * @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 eventType(): EventType = eventType.getRequired("event_type") + + /** + * Returns the raw JSON value of [eventType]. + * + * Unlike [eventType], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("event_type") + @ExcludeMissing + fun _eventType(): JsonField = eventType + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Visa]. + * + * The following fields are required: + * ```java + * .eventType() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Visa]. */ + class Builder internal constructor() { + + private var eventType: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(visa: Visa) = apply { + eventType = visa.eventType + additionalProperties = visa.additionalProperties.toMutableMap() + } + + /** The type of card dispute financial event. */ + fun eventType(eventType: EventType) = eventType(JsonField.of(eventType)) + + /** + * Sets [Builder.eventType] to an arbitrary JSON value. + * + * You should usually call [Builder.eventType] with a well-typed [EventType] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun eventType(eventType: JsonField) = apply { + this.eventType = eventType + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Visa]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .eventType() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Visa = + Visa( + checkRequired("eventType", eventType), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Visa = apply { + if (validated) { + return@apply + } + + eventType().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 = (eventType.asKnown().getOrNull()?.validity() ?: 0) + + /** The type of card dispute financial event. */ + class EventType + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + /** The user's chargeback was submitted. */ + @JvmField val CHARGEBACK_SUBMITTED = of("chargeback_submitted") + + /** The user declined the merchant's request for pre-arbitration. */ + @JvmField + val MERCHANT_PREARBITRATION_DECLINED = + of("merchant_prearbitration_declined") + + /** The merchant's request for pre-arbitration was received. */ + @JvmField + val MERCHANT_PREARBITRATION_RECEIVED = + of("merchant_prearbitration_received") + + /** The transaction was represented by the merchant. */ + @JvmField val REPRESENTED = of("represented") + + /** The user's request for pre-arbitration was declined. */ + @JvmField + val USER_PREARBITRATION_DECLINED = of("user_prearbitration_declined") + + /** The user's request for pre-arbitration was submitted. */ + @JvmField + val USER_PREARBITRATION_SUBMITTED = of("user_prearbitration_submitted") + + @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) + } + + /** An enum containing [EventType]'s known values. */ + enum class Known { + /** The user's chargeback was submitted. */ + CHARGEBACK_SUBMITTED, + /** The user declined the merchant's request for pre-arbitration. */ + MERCHANT_PREARBITRATION_DECLINED, + /** The merchant's request for pre-arbitration was received. */ + MERCHANT_PREARBITRATION_RECEIVED, + /** The transaction was represented by the merchant. */ + REPRESENTED, + /** The user's request for pre-arbitration was declined. */ + USER_PREARBITRATION_DECLINED, + /** The user's request for pre-arbitration was submitted. */ + USER_PREARBITRATION_SUBMITTED, + } + + /** + * An enum containing [EventType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [EventType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The user's chargeback was submitted. */ + CHARGEBACK_SUBMITTED, + /** The user declined the merchant's request for pre-arbitration. */ + MERCHANT_PREARBITRATION_DECLINED, + /** The merchant's request for pre-arbitration was received. */ + MERCHANT_PREARBITRATION_RECEIVED, + /** The transaction was represented by the merchant. */ + REPRESENTED, + /** The user's request for pre-arbitration was declined. */ + USER_PREARBITRATION_DECLINED, + /** The user's request for pre-arbitration was submitted. */ + USER_PREARBITRATION_SUBMITTED, + /** + * An enum member indicating that [EventType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + CHARGEBACK_SUBMITTED -> Value.CHARGEBACK_SUBMITTED + MERCHANT_PREARBITRATION_DECLINED -> + Value.MERCHANT_PREARBITRATION_DECLINED + MERCHANT_PREARBITRATION_RECEIVED -> + Value.MERCHANT_PREARBITRATION_RECEIVED + REPRESENTED -> Value.REPRESENTED + USER_PREARBITRATION_DECLINED -> Value.USER_PREARBITRATION_DECLINED + USER_PREARBITRATION_SUBMITTED -> Value.USER_PREARBITRATION_SUBMITTED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + CHARGEBACK_SUBMITTED -> Known.CHARGEBACK_SUBMITTED + MERCHANT_PREARBITRATION_DECLINED -> + Known.MERCHANT_PREARBITRATION_DECLINED + MERCHANT_PREARBITRATION_RECEIVED -> + Known.MERCHANT_PREARBITRATION_RECEIVED + REPRESENTED -> Known.REPRESENTED + USER_PREARBITRATION_DECLINED -> Known.USER_PREARBITRATION_DECLINED + USER_PREARBITRATION_SUBMITTED -> Known.USER_PREARBITRATION_SUBMITTED + else -> throw IncreaseInvalidDataException("Unknown EventType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws 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(): EventType = 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 /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Visa && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(eventType, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Visa{eventType=$eventType, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is CardDisputeFinancial && amount == other.amount && cardDisputeId == other.cardDisputeId && network == other.network && transactionId == other.transactionId && visa == other.visa && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(amount, cardDisputeId, network, transactionId, visa, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardDisputeFinancial{amount=$amount, cardDisputeId=$cardDisputeId, network=$network, transactionId=$transactionId, visa=$visa, additionalProperties=$additionalProperties}" + } + /** * A Card Dispute Loss object. This field will be present in the JSON response if and only * if `category` is equal to `card_dispute_loss`. Contains the details of a lost Card @@ -26451,6 +27350,12 @@ private constructor( */ @JvmField val CARD_DISPUTE_ACCEPTANCE = of("card_dispute_acceptance") + /** + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. + */ + @JvmField val CARD_DISPUTE_FINANCIAL = of("card_dispute_financial") + /** Card Dispute Loss: details will be under the `card_dispute_loss` object. */ @JvmField val CARD_DISPUTE_LOSS = of("card_dispute_loss") @@ -26613,6 +27518,11 @@ private constructor( * object. */ CARD_DISPUTE_ACCEPTANCE, + /** + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. + */ + CARD_DISPUTE_FINANCIAL, /** Card Dispute Loss: details will be under the `card_dispute_loss` object. */ CARD_DISPUTE_LOSS, /** Card Refund: details will be under the `card_refund` object. */ @@ -26747,6 +27657,11 @@ private constructor( * object. */ CARD_DISPUTE_ACCEPTANCE, + /** + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. + */ + CARD_DISPUTE_FINANCIAL, /** Card Dispute Loss: details will be under the `card_dispute_loss` object. */ CARD_DISPUTE_LOSS, /** Card Refund: details will be under the `card_refund` object. */ @@ -26866,6 +27781,7 @@ private constructor( ACH_TRANSFER_RETURN -> Value.ACH_TRANSFER_RETURN CASHBACK_PAYMENT -> Value.CASHBACK_PAYMENT CARD_DISPUTE_ACCEPTANCE -> Value.CARD_DISPUTE_ACCEPTANCE + CARD_DISPUTE_FINANCIAL -> Value.CARD_DISPUTE_FINANCIAL CARD_DISPUTE_LOSS -> Value.CARD_DISPUTE_LOSS CARD_REFUND -> Value.CARD_REFUND CARD_SETTLEMENT -> Value.CARD_SETTLEMENT @@ -26916,6 +27832,7 @@ private constructor( ACH_TRANSFER_RETURN -> Known.ACH_TRANSFER_RETURN CASHBACK_PAYMENT -> Known.CASHBACK_PAYMENT CARD_DISPUTE_ACCEPTANCE -> Known.CARD_DISPUTE_ACCEPTANCE + CARD_DISPUTE_FINANCIAL -> Known.CARD_DISPUTE_FINANCIAL CARD_DISPUTE_LOSS -> Known.CARD_DISPUTE_LOSS CARD_REFUND -> Known.CARD_REFUND CARD_SETTLEMENT -> Known.CARD_SETTLEMENT @@ -38555,17 +39472,17 @@ private constructor( return true } - return /* spotless:off */ other is Source && accountTransferIntention == other.accountTransferIntention && achTransferIntention == other.achTransferIntention && achTransferRejection == other.achTransferRejection && achTransferReturn == other.achTransferReturn && cardDisputeAcceptance == other.cardDisputeAcceptance && cardDisputeLoss == other.cardDisputeLoss && cardPushTransferAcceptance == other.cardPushTransferAcceptance && cardRefund == other.cardRefund && cardRevenuePayment == other.cardRevenuePayment && cardSettlement == other.cardSettlement && cashbackPayment == other.cashbackPayment && category == other.category && checkDepositAcceptance == other.checkDepositAcceptance && checkDepositReturn == other.checkDepositReturn && checkTransferDeposit == other.checkTransferDeposit && feePayment == other.feePayment && inboundAchTransfer == other.inboundAchTransfer && inboundAchTransferReturnIntention == other.inboundAchTransferReturnIntention && inboundCheckAdjustment == other.inboundCheckAdjustment && inboundCheckDepositReturnIntention == other.inboundCheckDepositReturnIntention && inboundRealTimePaymentsTransferConfirmation == other.inboundRealTimePaymentsTransferConfirmation && inboundRealTimePaymentsTransferDecline == other.inboundRealTimePaymentsTransferDecline && inboundWireReversal == other.inboundWireReversal && inboundWireTransfer == other.inboundWireTransfer && inboundWireTransferReversal == other.inboundWireTransferReversal && interestPayment == other.interestPayment && internalSource == other.internalSource && this.other == other.other && realTimePaymentsTransferAcknowledgement == other.realTimePaymentsTransferAcknowledgement && sampleFunds == other.sampleFunds && swiftTransferIntention == other.swiftTransferIntention && wireTransferIntention == other.wireTransferIntention && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Source && accountTransferIntention == other.accountTransferIntention && achTransferIntention == other.achTransferIntention && achTransferRejection == other.achTransferRejection && achTransferReturn == other.achTransferReturn && cardDisputeAcceptance == other.cardDisputeAcceptance && cardDisputeFinancial == other.cardDisputeFinancial && cardDisputeLoss == other.cardDisputeLoss && cardPushTransferAcceptance == other.cardPushTransferAcceptance && cardRefund == other.cardRefund && cardRevenuePayment == other.cardRevenuePayment && cardSettlement == other.cardSettlement && cashbackPayment == other.cashbackPayment && category == other.category && checkDepositAcceptance == other.checkDepositAcceptance && checkDepositReturn == other.checkDepositReturn && checkTransferDeposit == other.checkTransferDeposit && feePayment == other.feePayment && inboundAchTransfer == other.inboundAchTransfer && inboundAchTransferReturnIntention == other.inboundAchTransferReturnIntention && inboundCheckAdjustment == other.inboundCheckAdjustment && inboundCheckDepositReturnIntention == other.inboundCheckDepositReturnIntention && inboundRealTimePaymentsTransferConfirmation == other.inboundRealTimePaymentsTransferConfirmation && inboundRealTimePaymentsTransferDecline == other.inboundRealTimePaymentsTransferDecline && inboundWireReversal == other.inboundWireReversal && inboundWireTransfer == other.inboundWireTransfer && inboundWireTransferReversal == other.inboundWireTransferReversal && interestPayment == other.interestPayment && internalSource == other.internalSource && this.other == other.other && realTimePaymentsTransferAcknowledgement == other.realTimePaymentsTransferAcknowledgement && sampleFunds == other.sampleFunds && swiftTransferIntention == other.swiftTransferIntention && wireTransferIntention == other.wireTransferIntention && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountTransferIntention, achTransferIntention, achTransferRejection, achTransferReturn, cardDisputeAcceptance, cardDisputeLoss, cardPushTransferAcceptance, cardRefund, cardRevenuePayment, cardSettlement, cashbackPayment, category, checkDepositAcceptance, checkDepositReturn, checkTransferDeposit, feePayment, inboundAchTransfer, inboundAchTransferReturnIntention, inboundCheckAdjustment, inboundCheckDepositReturnIntention, inboundRealTimePaymentsTransferConfirmation, inboundRealTimePaymentsTransferDecline, inboundWireReversal, inboundWireTransfer, inboundWireTransferReversal, interestPayment, internalSource, other, realTimePaymentsTransferAcknowledgement, sampleFunds, swiftTransferIntention, wireTransferIntention, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountTransferIntention, achTransferIntention, achTransferRejection, achTransferReturn, cardDisputeAcceptance, cardDisputeFinancial, cardDisputeLoss, cardPushTransferAcceptance, cardRefund, cardRevenuePayment, cardSettlement, cashbackPayment, category, checkDepositAcceptance, checkDepositReturn, checkTransferDeposit, feePayment, inboundAchTransfer, inboundAchTransferReturnIntention, inboundCheckAdjustment, inboundCheckDepositReturnIntention, inboundRealTimePaymentsTransferConfirmation, inboundRealTimePaymentsTransferDecline, inboundWireReversal, inboundWireTransfer, inboundWireTransferReversal, interestPayment, internalSource, other, realTimePaymentsTransferAcknowledgement, sampleFunds, swiftTransferIntention, wireTransferIntention, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Source{accountTransferIntention=$accountTransferIntention, achTransferIntention=$achTransferIntention, achTransferRejection=$achTransferRejection, achTransferReturn=$achTransferReturn, cardDisputeAcceptance=$cardDisputeAcceptance, cardDisputeLoss=$cardDisputeLoss, cardPushTransferAcceptance=$cardPushTransferAcceptance, cardRefund=$cardRefund, cardRevenuePayment=$cardRevenuePayment, cardSettlement=$cardSettlement, cashbackPayment=$cashbackPayment, category=$category, checkDepositAcceptance=$checkDepositAcceptance, checkDepositReturn=$checkDepositReturn, checkTransferDeposit=$checkTransferDeposit, feePayment=$feePayment, inboundAchTransfer=$inboundAchTransfer, inboundAchTransferReturnIntention=$inboundAchTransferReturnIntention, inboundCheckAdjustment=$inboundCheckAdjustment, inboundCheckDepositReturnIntention=$inboundCheckDepositReturnIntention, inboundRealTimePaymentsTransferConfirmation=$inboundRealTimePaymentsTransferConfirmation, inboundRealTimePaymentsTransferDecline=$inboundRealTimePaymentsTransferDecline, inboundWireReversal=$inboundWireReversal, inboundWireTransfer=$inboundWireTransfer, inboundWireTransferReversal=$inboundWireTransferReversal, interestPayment=$interestPayment, internalSource=$internalSource, other=$other, realTimePaymentsTransferAcknowledgement=$realTimePaymentsTransferAcknowledgement, sampleFunds=$sampleFunds, swiftTransferIntention=$swiftTransferIntention, wireTransferIntention=$wireTransferIntention, additionalProperties=$additionalProperties}" + "Source{accountTransferIntention=$accountTransferIntention, achTransferIntention=$achTransferIntention, achTransferRejection=$achTransferRejection, achTransferReturn=$achTransferReturn, cardDisputeAcceptance=$cardDisputeAcceptance, cardDisputeFinancial=$cardDisputeFinancial, cardDisputeLoss=$cardDisputeLoss, cardPushTransferAcceptance=$cardPushTransferAcceptance, cardRefund=$cardRefund, cardRevenuePayment=$cardRevenuePayment, cardSettlement=$cardSettlement, cashbackPayment=$cashbackPayment, category=$category, checkDepositAcceptance=$checkDepositAcceptance, checkDepositReturn=$checkDepositReturn, checkTransferDeposit=$checkTransferDeposit, feePayment=$feePayment, inboundAchTransfer=$inboundAchTransfer, inboundAchTransferReturnIntention=$inboundAchTransferReturnIntention, inboundCheckAdjustment=$inboundCheckAdjustment, inboundCheckDepositReturnIntention=$inboundCheckDepositReturnIntention, inboundRealTimePaymentsTransferConfirmation=$inboundRealTimePaymentsTransferConfirmation, inboundRealTimePaymentsTransferDecline=$inboundRealTimePaymentsTransferDecline, inboundWireReversal=$inboundWireReversal, inboundWireTransfer=$inboundWireTransfer, inboundWireTransferReversal=$inboundWireTransferReversal, interestPayment=$interestPayment, internalSource=$internalSource, other=$other, realTimePaymentsTransferAcknowledgement=$realTimePaymentsTransferAcknowledgement, sampleFunds=$sampleFunds, swiftTransferIntention=$swiftTransferIntention, wireTransferIntention=$wireTransferIntention, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListParams.kt index d71ce54f7..a536bba19 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListParams.kt @@ -449,6 +449,12 @@ private constructor( */ @JvmField val CARD_DISPUTE_ACCEPTANCE = of("card_dispute_acceptance") + /** + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. + */ + @JvmField val CARD_DISPUTE_FINANCIAL = of("card_dispute_financial") + /** Card Dispute Loss: details will be under the `card_dispute_loss` object. */ @JvmField val CARD_DISPUTE_LOSS = of("card_dispute_loss") @@ -611,6 +617,11 @@ private constructor( * object. */ CARD_DISPUTE_ACCEPTANCE, + /** + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. + */ + CARD_DISPUTE_FINANCIAL, /** Card Dispute Loss: details will be under the `card_dispute_loss` object. */ CARD_DISPUTE_LOSS, /** Card Refund: details will be under the `card_refund` object. */ @@ -745,6 +756,11 @@ private constructor( * object. */ CARD_DISPUTE_ACCEPTANCE, + /** + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. + */ + CARD_DISPUTE_FINANCIAL, /** Card Dispute Loss: details will be under the `card_dispute_loss` object. */ CARD_DISPUTE_LOSS, /** Card Refund: details will be under the `card_refund` object. */ @@ -862,6 +878,7 @@ private constructor( ACH_TRANSFER_RETURN -> Value.ACH_TRANSFER_RETURN CASHBACK_PAYMENT -> Value.CASHBACK_PAYMENT CARD_DISPUTE_ACCEPTANCE -> Value.CARD_DISPUTE_ACCEPTANCE + CARD_DISPUTE_FINANCIAL -> Value.CARD_DISPUTE_FINANCIAL CARD_DISPUTE_LOSS -> Value.CARD_DISPUTE_LOSS CARD_REFUND -> Value.CARD_REFUND CARD_SETTLEMENT -> Value.CARD_SETTLEMENT @@ -912,6 +929,7 @@ private constructor( ACH_TRANSFER_RETURN -> Known.ACH_TRANSFER_RETURN CASHBACK_PAYMENT -> Known.CASHBACK_PAYMENT CARD_DISPUTE_ACCEPTANCE -> Known.CARD_DISPUTE_ACCEPTANCE + CARD_DISPUTE_FINANCIAL -> Known.CARD_DISPUTE_FINANCIAL CARD_DISPUTE_LOSS -> Known.CARD_DISPUTE_LOSS CARD_REFUND -> Known.CARD_REFUND CARD_SETTLEMENT -> Known.CARD_SETTLEMENT diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt index 2d1e08172..e5db8ae95 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt @@ -74,6 +74,25 @@ internal class TransactionListPageResponseTest { .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() ) + .cardDisputeFinancial( + Transaction.Source.CardDisputeFinancial.builder() + .amount(1000L) + .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") + .network( + Transaction.Source.CardDisputeFinancial.Network.VISA + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .visa( + Transaction.Source.CardDisputeFinancial.Visa.builder() + .eventType( + Transaction.Source.CardDisputeFinancial.Visa + .EventType + .CHARGEBACK_SUBMITTED + ) + .build() + ) + .build() + ) .cardDisputeLoss( Transaction.Source.CardDisputeLoss.builder() .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") @@ -962,6 +981,23 @@ internal class TransactionListPageResponseTest { .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() ) + .cardDisputeFinancial( + Transaction.Source.CardDisputeFinancial.builder() + .amount(1000L) + .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") + .network(Transaction.Source.CardDisputeFinancial.Network.VISA) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .visa( + Transaction.Source.CardDisputeFinancial.Visa.builder() + .eventType( + Transaction.Source.CardDisputeFinancial.Visa + .EventType + .CHARGEBACK_SUBMITTED + ) + .build() + ) + .build() + ) .cardDisputeLoss( Transaction.Source.CardDisputeLoss.builder() .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") @@ -1814,6 +1850,25 @@ internal class TransactionListPageResponseTest { .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() ) + .cardDisputeFinancial( + Transaction.Source.CardDisputeFinancial.builder() + .amount(1000L) + .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") + .network( + Transaction.Source.CardDisputeFinancial.Network.VISA + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .visa( + Transaction.Source.CardDisputeFinancial.Visa.builder() + .eventType( + Transaction.Source.CardDisputeFinancial.Visa + .EventType + .CHARGEBACK_SUBMITTED + ) + .build() + ) + .build() + ) .cardDisputeLoss( Transaction.Source.CardDisputeLoss.builder() .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt index 495df3767..ec2615505 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt @@ -70,6 +70,22 @@ internal class TransactionTest { .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() ) + .cardDisputeFinancial( + Transaction.Source.CardDisputeFinancial.builder() + .amount(1000L) + .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") + .network(Transaction.Source.CardDisputeFinancial.Network.VISA) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .visa( + Transaction.Source.CardDisputeFinancial.Visa.builder() + .eventType( + Transaction.Source.CardDisputeFinancial.Visa.EventType + .CHARGEBACK_SUBMITTED + ) + .build() + ) + .build() + ) .cardDisputeLoss( Transaction.Source.CardDisputeLoss.builder() .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") @@ -872,6 +888,22 @@ internal class TransactionTest { .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() ) + .cardDisputeFinancial( + Transaction.Source.CardDisputeFinancial.builder() + .amount(1000L) + .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") + .network(Transaction.Source.CardDisputeFinancial.Network.VISA) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .visa( + Transaction.Source.CardDisputeFinancial.Visa.builder() + .eventType( + Transaction.Source.CardDisputeFinancial.Visa.EventType + .CHARGEBACK_SUBMITTED + ) + .build() + ) + .build() + ) .cardDisputeLoss( Transaction.Source.CardDisputeLoss.builder() .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") @@ -1632,6 +1664,22 @@ internal class TransactionTest { .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() ) + .cardDisputeFinancial( + Transaction.Source.CardDisputeFinancial.builder() + .amount(1000L) + .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") + .network(Transaction.Source.CardDisputeFinancial.Network.VISA) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .visa( + Transaction.Source.CardDisputeFinancial.Visa.builder() + .eventType( + Transaction.Source.CardDisputeFinancial.Visa.EventType + .CHARGEBACK_SUBMITTED + ) + .build() + ) + .build() + ) .cardDisputeLoss( Transaction.Source.CardDisputeLoss.builder() .cardDisputeId("card_dispute_h9sc95nbl1cgltpp7men") diff --git a/increase-java-example/build.gradle.kts b/increase-java-example/build.gradle.kts index dbe0da68f..27d8fa75a 100644 --- a/increase-java-example/build.gradle.kts +++ b/increase-java-example/build.gradle.kts @@ -18,7 +18,7 @@ tasks.withType().configureEach { application { // Use `./gradlew :increase-java-example:run` to run `Main` - // Use `./gradlew :increase-java-example:run -Dexample=Something` to run `SomethingExample` + // Use `./gradlew :increase-java-example:run -Pexample=Something` to run `SomethingExample` mainClass = "com.increase.api.example.${ if (project.hasProperty("example")) "${project.property("example")}Example"