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.161.0"
".": "0.162.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 201
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-700b81dedcec3b98097b9fa7c1ab7ea971cc812c95d7507db3a235a625660394.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-5ea7ed56030d4b00596b425a2efee0459583f4e0e283daad7ebb63a0cd76d29f.yml
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.162.0 (2025-01-14)

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

### Features

* **api:** api update ([#694](https://github.com/Increase/increase-java/issues/694)) ([a4a521b](https://github.com/Increase/increase-java/commit/a4a521bf4d2937f97472ab6765df88ea8a04a452))


### Chores

* **internal:** add and tweak check functions ([#692](https://github.com/Increase/increase-java/issues/692)) ([abbf2d2](https://github.com/Increase/increase-java/commit/abbf2d2cb7f925b2eb15f0f2e6c57f878cf80e00))
* **internal:** tweak client options nullability handling ([abbf2d2](https://github.com/Increase/increase-java/commit/abbf2d2cb7f925b2eb15f0f2e6c57f878cf80e00))

## 0.161.0 (2025-01-14)

Full Changelog: [v0.160.0...v0.161.0](https://github.com/Increase/increase-java/compare/v0.160.0...v0.161.0)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- 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.161.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.162.0)

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

Expand All @@ -25,7 +25,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/
<!-- x-release-please-start-version -->

```kotlin
implementation("com.increase.api:increase-java:0.161.0")
implementation("com.increase.api:increase-java:0.162.0")
```

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

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
allprojects {
group = "com.increase.api"
version = "0.161.0" // x-release-please-version
version = "0.162.0" // x-release-please-version
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,27 @@ package com.increase.api.core

@JvmSynthetic
internal fun <T : Any> checkRequired(name: String, value: T?): T =
checkNotNull(value) { "`$name` is required but was not set" }
checkNotNull(value) { "`$name` is required, but was not set" }

@JvmSynthetic
internal fun checkLength(name: String, value: String, length: Int): String =
value.also {
check(it.length == length) { "`$name` must have length $length, but was ${it.length}" }
}

@JvmSynthetic
internal fun checkMinLength(name: String, value: String, minLength: Int): String =
value.also {
check(it.length >= minLength) {
if (minLength == 1) "`$name` must be non-empty, but was empty"
else "`$name` must have at least length $minLength, but was ${it.length}"
}
}

@JvmSynthetic
internal fun checkMaxLength(name: String, value: String, maxLength: Int): String =
value.also {
check(it.length <= maxLength) {
"`$name` must have at most length $maxLength, but was ${it.length}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ private constructor(
}

fun build(): ClientOptions {
checkRequired("httpClient", httpClient)
checkRequired("apiKey", apiKey)
val httpClient = checkRequired("httpClient", httpClient)
val apiKey = checkRequired("apiKey", apiKey)

val headers = Headers.builder()
val queryParams = QueryParams.builder()
Expand All @@ -185,7 +185,7 @@ private constructor(
headers.put("X-Stainless-Package-Version", getPackageVersion())
headers.put("X-Stainless-Runtime", "JRE")
headers.put("X-Stainless-Runtime-Version", getJavaVersion())
apiKey?.let {
apiKey.let {
if (!it.isEmpty()) {
headers.put("Authorization", "Bearer $it")
}
Expand All @@ -194,10 +194,10 @@ private constructor(
queryParams.replaceAll(this.queryParams.build())

return ClientOptions(
httpClient!!,
httpClient,
PhantomReachableClosingHttpClient(
RetryingHttpClient.builder()
.httpClient(httpClient!!)
.httpClient(httpClient)
.clock(clock)
.maxRetries(maxRetries)
.idempotencyHeader("Idempotency-Key")
Expand All @@ -210,7 +210,7 @@ private constructor(
queryParams.build(),
responseValidation,
maxRetries,
apiKey!!,
apiKey,
webhookSecret,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ sealed class JsonField<out T : Any> {
is JsonValue -> this
}

@JvmSynthetic fun accept(consume: (T) -> Unit) = asKnown().ifPresent(consume)

fun <R> accept(visitor: Visitor<T, R>): R =
when (this) {
is KnownValue -> visitor.visitKnown(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ private constructor(
/** The status of the transfer. */
fun status(): Status = status.getRequired("status")

/** The trace number of the transfer. */
/**
* A 15 digit number set by the sending bank and transmitted to the receiving bank. Along with
* the amount, date, and originating routing number, this can be used to identify the ACH
* transfer. ACH trace numbers are not unique, but are
* [used to correlate returns](https://increase.com/documentation/ach-returns#ach-returns).
*/
fun traceNumber(): String = traceNumber.getRequired("trace_number")

/** If your transfer is returned, this will contain details of the return. */
Expand Down Expand Up @@ -326,7 +331,12 @@ private constructor(
/** The status of the transfer. */
@JsonProperty("status") @ExcludeMissing fun _status(): JsonField<Status> = status

/** The trace number of the transfer. */
/**
* A 15 digit number set by the sending bank and transmitted to the receiving bank. Along with
* the amount, date, and originating routing number, this can be used to identify the ACH
* transfer. ACH trace numbers are not unique, but are
* [used to correlate returns](https://increase.com/documentation/ach-returns#ach-returns).
*/
@JsonProperty("trace_number")
@ExcludeMissing
fun _traceNumber(): JsonField<String> = traceNumber
Expand Down Expand Up @@ -699,10 +709,20 @@ private constructor(
/** The status of the transfer. */
fun status(status: JsonField<Status>) = apply { this.status = status }

/** The trace number of the transfer. */
/**
* A 15 digit number set by the sending bank and transmitted to the receiving bank. Along
* with the amount, date, and originating routing number, this can be used to identify the
* ACH transfer. ACH trace numbers are not unique, but are
* [used to correlate returns](https://increase.com/documentation/ach-returns#ach-returns).
*/
fun traceNumber(traceNumber: String) = traceNumber(JsonField.of(traceNumber))

/** The trace number of the transfer. */
/**
* A 15 digit number set by the sending bank and transmitted to the receiving bank. Along
* with the amount, date, and originating routing number, this can be used to identify the
* ACH transfer. ACH trace numbers are not unique, but are
* [used to correlate returns](https://increase.com/documentation/ach-returns#ach-returns).
*/
fun traceNumber(traceNumber: JsonField<String>) = apply { this.traceNumber = traceNumber }

/** If your transfer is returned, this will contain details of the return. */
Expand Down
Loading