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.396.0"
".": "0.397.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 232
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-a559a6a1a1f3781fad8db5bcb96c40b69a78b952d659395840accce782098e0c.yml
openapi_spec_hash: 2ae62041468e5cf6fe653d65b1b7a58a
config_hash: 8a9bb9e2d5dd0ccc3e78ad59f924fd3c
config_hash: 3ccb2793be25ae0b15e05dc9ef5da09c
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.397.0 (2026-01-16)

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

### Features

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


### Chores

* **internal:** clean up maven repo artifact script and add html documentation to repo root ([cf9cda9](https://github.com/Increase/increase-java/commit/cf9cda9e2963052c860047c6d6795ae977b52c0b))

## 0.396.0 (2026-01-14)

Full Changelog: [v0.395.0...v0.396.0](https://github.com/Increase/increase-java/compare/v0.395.0...v0.396.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.396.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.396.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.396.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.397.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.397.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.397.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.396.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.397.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.396.0")
implementation("com.increase.api:increase-java:0.397.0")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.396.0")
<dependency>
<groupId>com.increase.api</groupId>
<artifactId>increase-java</artifactId>
<version>0.396.0</version>
<version>0.397.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.396.0" // x-release-please-version
version = "0.397.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@file:JvmName("EmptyHandler")

package com.increase.api.core.handlers

import com.increase.api.core.http.HttpResponse
import com.increase.api.core.http.HttpResponse.Handler

@JvmSynthetic internal fun emptyHandler(): Handler<Void?> = EmptyHandlerInternal

private object EmptyHandlerInternal : Handler<Void?> {
override fun handle(response: HttpResponse): Void? = null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// File generated from our OpenAPI spec by Stainless.

package com.increase.api.models.events

import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
import com.increase.api.core.ExcludeMissing
import com.increase.api.core.JsonValue
import com.increase.api.errors.IncreaseInvalidDataException
import java.util.Collections
import java.util.Objects

class UnwrapWebhookEvent
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(private val additionalProperties: MutableMap<String, JsonValue>) {

@JsonCreator private constructor() : this(mutableMapOf())

@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
}

@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map<String, JsonValue> =
Collections.unmodifiableMap(additionalProperties)

fun toBuilder() = Builder().from(this)

companion object {

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

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

private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(unwrapWebhookEvent: UnwrapWebhookEvent) = apply {
additionalProperties = unwrapWebhookEvent.additionalProperties.toMutableMap()
}

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
}

fun putAdditionalProperty(key: String, value: JsonValue) = apply {
additionalProperties.put(key, value)
}

fun putAllAdditionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.putAll(additionalProperties)
}

fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }

fun removeAllAdditionalProperties(keys: Set<String>) = apply {
keys.forEach(::removeAdditionalProperty)
}

/**
* Returns an immutable instance of [UnwrapWebhookEvent].
*
* Further updates to this [Builder] will not mutate the returned instance.
*/
fun build(): UnwrapWebhookEvent = UnwrapWebhookEvent(additionalProperties.toMutableMap())
}

private var validated: Boolean = false

fun validate(): UnwrapWebhookEvent = apply {
if (validated) {
return@apply
}

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 = 0

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is UnwrapWebhookEvent && additionalProperties == other.additionalProperties
}

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

override fun hashCode(): Int = hashCode

override fun toString() = "UnwrapWebhookEvent{additionalProperties=$additionalProperties}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package com.increase.api.services.async
import com.increase.api.core.ClientOptions
import com.increase.api.core.RequestOptions
import com.increase.api.core.http.HttpResponseFor
import com.increase.api.errors.IncreaseInvalidDataException
import com.increase.api.models.events.Event
import com.increase.api.models.events.EventListPageAsync
import com.increase.api.models.events.EventListParams
import com.increase.api.models.events.EventRetrieveParams
import com.increase.api.models.events.UnwrapWebhookEvent
import java.util.concurrent.CompletableFuture
import java.util.function.Consumer

Expand Down Expand Up @@ -76,6 +78,13 @@ interface EventServiceAsync {
fun list(requestOptions: RequestOptions): CompletableFuture<EventListPageAsync> =
list(EventListParams.none(), requestOptions)

/**
* Unwraps a webhook event from its JSON representation.
*
* @throws IncreaseInvalidDataException if the body could not be parsed.
*/
fun unwrap(body: String): UnwrapWebhookEvent

/** A view of [EventServiceAsync] that provides access to raw HTTP responses for each method. */
interface WithRawResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ import com.increase.api.core.http.HttpResponse.Handler
import com.increase.api.core.http.HttpResponseFor
import com.increase.api.core.http.parseable
import com.increase.api.core.prepareAsync
import com.increase.api.errors.IncreaseInvalidDataException
import com.increase.api.models.events.Event
import com.increase.api.models.events.EventListPageAsync
import com.increase.api.models.events.EventListPageResponse
import com.increase.api.models.events.EventListParams
import com.increase.api.models.events.EventRetrieveParams
import com.increase.api.models.events.UnwrapWebhookEvent
import com.increase.api.services.blocking.EventServiceImpl
import java.util.concurrent.CompletableFuture
import java.util.function.Consumer
import kotlin.jvm.optionals.getOrNull
Expand Down Expand Up @@ -50,6 +53,14 @@ class EventServiceAsyncImpl internal constructor(private val clientOptions: Clie
// get /events
withRawResponse().list(params, requestOptions).thenApply { it.parse() }

/**
* Unwraps a webhook event from its JSON representation.
*
* @throws IncreaseInvalidDataException if the body could not be parsed.
*/
override fun unwrap(body: String): UnwrapWebhookEvent =
EventServiceImpl(clientOptions).unwrap(body)

class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
EventServiceAsync.WithRawResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import com.google.errorprone.annotations.MustBeClosed
import com.increase.api.core.ClientOptions
import com.increase.api.core.RequestOptions
import com.increase.api.core.http.HttpResponseFor
import com.increase.api.errors.IncreaseInvalidDataException
import com.increase.api.models.events.Event
import com.increase.api.models.events.EventListPage
import com.increase.api.models.events.EventListParams
import com.increase.api.models.events.EventRetrieveParams
import com.increase.api.models.events.UnwrapWebhookEvent
import java.util.function.Consumer

interface EventService {
Expand Down Expand Up @@ -70,6 +72,13 @@ interface EventService {
fun list(requestOptions: RequestOptions): EventListPage =
list(EventListParams.none(), requestOptions)

/**
* Unwraps a webhook event from its JSON representation.
*
* @throws IncreaseInvalidDataException if the body could not be parsed.
*/
fun unwrap(body: String): UnwrapWebhookEvent

/** A view of [EventService] that provides access to raw HTTP responses for each method. */
interface WithRawResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package com.increase.api.services.blocking

import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
import com.increase.api.core.ClientOptions
import com.increase.api.core.RequestOptions
import com.increase.api.core.checkRequired
Expand All @@ -15,11 +16,13 @@ import com.increase.api.core.http.HttpResponse.Handler
import com.increase.api.core.http.HttpResponseFor
import com.increase.api.core.http.parseable
import com.increase.api.core.prepare
import com.increase.api.errors.IncreaseInvalidDataException
import com.increase.api.models.events.Event
import com.increase.api.models.events.EventListPage
import com.increase.api.models.events.EventListPageResponse
import com.increase.api.models.events.EventListParams
import com.increase.api.models.events.EventRetrieveParams
import com.increase.api.models.events.UnwrapWebhookEvent
import java.util.function.Consumer
import kotlin.jvm.optionals.getOrNull

Expand All @@ -43,6 +46,18 @@ class EventServiceImpl internal constructor(private val clientOptions: ClientOpt
// get /events
withRawResponse().list(params, requestOptions).parse()

/**
* Unwraps a webhook event from its JSON representation.
*
* @throws IncreaseInvalidDataException if the body could not be parsed.
*/
override fun unwrap(body: String): UnwrapWebhookEvent =
try {
clientOptions.jsonMapper.readValue(body, jacksonTypeRef<UnwrapWebhookEvent>())
} catch (e: Exception) {
throw IncreaseInvalidDataException("Error parsing body", e)
}

class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
EventService.WithRawResponse {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// File generated from our OpenAPI spec by Stainless.

package com.increase.api.models.events

import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
import com.increase.api.core.jsonMapper
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class UnwrapWebhookEventTest {

@Test
fun create() {
val unwrapWebhookEvent = UnwrapWebhookEvent.builder().build()
}

@Test
fun roundtrip() {
val jsonMapper = jsonMapper()
val unwrapWebhookEvent = UnwrapWebhookEvent.builder().build()

val roundtrippedUnwrapWebhookEvent =
jsonMapper.readValue(
jsonMapper.writeValueAsString(unwrapWebhookEvent),
jacksonTypeRef<UnwrapWebhookEvent>(),
)

assertThat(roundtrippedUnwrapWebhookEvent).isEqualTo(unwrapWebhookEvent)
}
}
Loading
Loading