Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.338.0"
".": "0.339.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 214
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-749004bde06df3642fccde727f8e872c02795128db180789d1377c3168bd71ba.yml
openapi_spec_hash: 9058f9b3951c7608de5b67d8d5c87ffd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c51555226fd66ed304eb1e9c759a6485c071eb2cb9ca9ee86f5b5cd88552ee4a.yml
openapi_spec_hash: c5b09ec531c068cb675f8cd3729733c6
config_hash: a143293c5450ae8f52acad08f3102575
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.339.0 (2025-09-26)

Full Changelog: [v0.338.0...v0.339.0](https://github.com/Increase/increase-java/compare/v0.338.0...v0.339.0)

### Features

* **api:** api update ([ef56185](https://github.com/Increase/increase-java/commit/ef561852f606957fefab5235b62d1238063a56c4))

## 0.338.0 (2025-09-26)

Full Changelog: [v0.337.1...v0.338.0](https://github.com/Increase/increase-java/compare/v0.337.1...v0.338.0)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- x-release-please-start-version -->

[![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.338.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.338.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.338.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.339.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.339.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.339.0)

<!-- x-release-please-end -->

Expand All @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe

<!-- x-release-please-start-version -->

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.338.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.339.0).

<!-- x-release-please-end -->

Expand All @@ -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.338.0")
implementation("com.increase.api:increase-java:0.339.0")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.338.0")
<dependency>
<groupId>com.increase.api</groupId>
<artifactId>increase-java</artifactId>
<version>0.338.0</version>
<version>0.339.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.increase.api"
version = "0.338.0" // x-release-please-version
version = "0.339.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ 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

/**
* Simulates refunding a card transaction. The full value of the original sandbox transaction is
Expand All @@ -29,14 +29,32 @@ private constructor(
private val additionalQueryParams: QueryParams,
) : Params {

/**
* The identifier of the Pending Transaction for the refund authorization. If this is provided,
* `transaction` must not be provided as a refund with a refund authorized can not be linked to
* a regular transaction.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun pendingTransactionId(): Optional<String> = body.pendingTransactionId()

/**
* The identifier for the Transaction to refund. The Transaction's source must have a category
* 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).
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun transactionId(): Optional<String> = body.transactionId()

/**
* Returns the raw JSON value of [pendingTransactionId].
*
* Unlike [pendingTransactionId], this method doesn't throw if the JSON field has an unexpected
* type.
*/
fun transactionId(): String = body.transactionId()
fun _pendingTransactionId(): JsonField<String> = body._pendingTransactionId()

/**
* Returns the raw JSON value of [transactionId].
Expand All @@ -57,14 +75,9 @@ private constructor(

companion object {

/**
* Returns a mutable builder for constructing an instance of [CardRefundCreateParams].
*
* The following fields are required:
* ```java
* .transactionId()
* ```
*/
@JvmStatic fun none(): CardRefundCreateParams = builder().build()

/** Returns a mutable builder for constructing an instance of [CardRefundCreateParams]. */
@JvmStatic fun builder() = Builder()
}

Expand All @@ -87,10 +100,31 @@ private constructor(
*
* 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:
* - [pendingTransactionId]
* - [transactionId]
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }

/**
* The identifier of the Pending Transaction for the refund authorization. If this is
* provided, `transaction` must not be provided as a refund with a refund authorized can not
* be linked to a regular transaction.
*/
fun pendingTransactionId(pendingTransactionId: String) = apply {
body.pendingTransactionId(pendingTransactionId)
}

/**
* Sets [Builder.pendingTransactionId] to an arbitrary JSON value.
*
* You should usually call [Builder.pendingTransactionId] with a well-typed [String] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun pendingTransactionId(pendingTransactionId: JsonField<String>) = apply {
body.pendingTransactionId(pendingTransactionId)
}

/**
* The identifier for the Transaction to refund. The Transaction's source must have a
* category of card_settlement.
Expand Down Expand Up @@ -229,13 +263,6 @@ private constructor(
* Returns an immutable instance of [CardRefundCreateParams].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
* .transactionId()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
fun build(): CardRefundCreateParams =
CardRefundCreateParams(
Expand All @@ -254,25 +281,50 @@ private constructor(
class Body
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val pendingTransactionId: JsonField<String>,
private val transactionId: JsonField<String>,
private val additionalProperties: MutableMap<String, JsonValue>,
) {

@JsonCreator
private constructor(
@JsonProperty("pending_transaction_id")
@ExcludeMissing
pendingTransactionId: JsonField<String> = JsonMissing.of(),
@JsonProperty("transaction_id")
@ExcludeMissing
transactionId: JsonField<String> = JsonMissing.of()
) : this(transactionId, mutableMapOf())
transactionId: JsonField<String> = JsonMissing.of(),
) : this(pendingTransactionId, transactionId, mutableMapOf())

/**
* The identifier of the Pending Transaction for the refund authorization. If this is
* provided, `transaction` must not be provided as a refund with a refund authorized can not
* be linked to a regular transaction.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun pendingTransactionId(): Optional<String> =
pendingTransactionId.getOptional("pending_transaction_id")

/**
* The identifier for the Transaction to refund. The Transaction's source must have a
* category 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).
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun transactionId(): Optional<String> = transactionId.getOptional("transaction_id")

/**
* Returns the raw JSON value of [pendingTransactionId].
*
* Unlike [pendingTransactionId], this method doesn't throw if the JSON field has an
* unexpected type.
*/
fun transactionId(): String = transactionId.getRequired("transaction_id")
@JsonProperty("pending_transaction_id")
@ExcludeMissing
fun _pendingTransactionId(): JsonField<String> = pendingTransactionId

/**
* Returns the raw JSON value of [transactionId].
Expand All @@ -298,29 +350,43 @@ private constructor(

companion object {

/**
* Returns a mutable builder for constructing an instance of [Body].
*
* The following fields are required:
* ```java
* .transactionId()
* ```
*/
/** Returns a mutable builder for constructing an instance of [Body]. */
@JvmStatic fun builder() = Builder()
}

/** A builder for [Body]. */
class Builder internal constructor() {

private var transactionId: JsonField<String>? = null
private var pendingTransactionId: JsonField<String> = JsonMissing.of()
private var transactionId: JsonField<String> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(body: Body) = apply {
pendingTransactionId = body.pendingTransactionId
transactionId = body.transactionId
additionalProperties = body.additionalProperties.toMutableMap()
}

/**
* The identifier of the Pending Transaction for the refund authorization. If this is
* provided, `transaction` must not be provided as a refund with a refund authorized can
* not be linked to a regular transaction.
*/
fun pendingTransactionId(pendingTransactionId: String) =
pendingTransactionId(JsonField.of(pendingTransactionId))

/**
* Sets [Builder.pendingTransactionId] to an arbitrary JSON value.
*
* You should usually call [Builder.pendingTransactionId] with a well-typed [String]
* value instead. This method is primarily for setting the field to an undocumented or
* not yet supported value.
*/
fun pendingTransactionId(pendingTransactionId: JsonField<String>) = apply {
this.pendingTransactionId = pendingTransactionId
}

/**
* The identifier for the Transaction to refund. The Transaction's source must have a
* category of card_settlement.
Expand Down Expand Up @@ -361,19 +427,9 @@ private constructor(
* Returns an immutable instance of [Body].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
* .transactionId()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
fun build(): Body =
Body(
checkRequired("transactionId", transactionId),
additionalProperties.toMutableMap(),
)
Body(pendingTransactionId, transactionId, additionalProperties.toMutableMap())
}

private var validated: Boolean = false
Expand All @@ -383,6 +439,7 @@ private constructor(
return@apply
}

pendingTransactionId()
transactionId()
validated = true
}
Expand All @@ -402,24 +459,29 @@ private constructor(
* Used for best match union deserialization.
*/
@JvmSynthetic
internal fun validity(): Int = (if (transactionId.asKnown().isPresent) 1 else 0)
internal fun validity(): Int =
(if (pendingTransactionId.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 Body &&
pendingTransactionId == other.pendingTransactionId &&
transactionId == other.transactionId &&
additionalProperties == other.additionalProperties
}

private val hashCode: Int by lazy { Objects.hash(transactionId, additionalProperties) }
private val hashCode: Int by lazy {
Objects.hash(pendingTransactionId, transactionId, additionalProperties)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"Body{transactionId=$transactionId, additionalProperties=$additionalProperties}"
"Body{pendingTransactionId=$pendingTransactionId, transactionId=$transactionId, additionalProperties=$additionalProperties}"
}

override fun equals(other: Any?): Boolean {
Expand Down
Loading
Loading