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.264.0"
".": "0.265.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: 202
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-43d34b4805f305e7e2c71644ade73722d053018acd6009352360e8a87cbe2250.yml
openapi_spec_hash: cfff23de89960d895052350a33499cf1
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4d843be8e5d44f9d79115d585ffdcda4b4d86a5f515fb00e547ba085156f44bb.yml
openapi_spec_hash: f5473cf6107b72c78bc87ecbc421dc5e
config_hash: a185e9a72778cc4658ea73fb3a7f1354
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.265.0 (2025-07-22)

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

### Features

* **api:** api update ([2e242ef](https://github.com/Increase/increase-java/commit/2e242ef5f7daaa7585e95eca727655bf8f3d20ef))
* **api:** api update ([568351c](https://github.com/Increase/increase-java/commit/568351c2a6089f37ba721cf6f92f4b23fc43ce2c))
* **client:** add `{QueryParams,Headers}#put(String, JsonValue)` methods ([eb5e260](https://github.com/Increase/increase-java/commit/eb5e260b07b4c3490a5a3de3d8f2bb70e78683c2))

## 0.264.0 (2025-07-21)

Full Changelog: [v0.263.0...v0.264.0](https://github.com/Increase/increase-java/compare/v0.263.0...v0.264.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.264.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.264.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.264.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.265.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.265.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.265.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.264.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.265.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.264.0")
implementation("com.increase.api:increase-java:0.265.0")
```

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

subprojects {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// File generated from our OpenAPI spec by Stainless.

package com.increase.api.core.http

import com.increase.api.core.JsonArray
import com.increase.api.core.JsonBoolean
import com.increase.api.core.JsonMissing
import com.increase.api.core.JsonNull
import com.increase.api.core.JsonNumber
import com.increase.api.core.JsonObject
import com.increase.api.core.JsonString
import com.increase.api.core.JsonValue
import com.increase.api.core.toImmutable
import java.util.TreeMap

Expand Down Expand Up @@ -28,6 +38,19 @@ private constructor(
TreeMap(String.CASE_INSENSITIVE_ORDER)
private var size: Int = 0

fun put(name: String, value: JsonValue): Builder = apply {
when (value) {
is JsonMissing,
is JsonNull -> {}
is JsonBoolean -> put(name, value.value.toString())
is JsonNumber -> put(name, value.value.toString())
is JsonString -> put(name, value.value)
is JsonArray -> value.values.forEach { put(name, it) }
is JsonObject ->
value.values.forEach { (nestedName, value) -> put("$name.$nestedName", value) }
}
}

fun put(name: String, value: String) = apply {
map.getOrPut(name) { mutableListOf() }.add(value)
size++
Expand All @@ -41,15 +64,6 @@ private constructor(
headers.names().forEach { put(it, headers.values(it)) }
}

fun remove(name: String) = apply { size -= map.remove(name).orEmpty().size }

fun removeAll(names: Set<String>) = apply { names.forEach(::remove) }

fun clear() = apply {
map.clear()
size = 0
}

fun replace(name: String, value: String) = apply {
remove(name)
put(name, value)
Expand All @@ -68,6 +82,15 @@ private constructor(
headers.names().forEach { replace(it, headers.values(it)) }
}

fun remove(name: String) = apply { size -= map.remove(name).orEmpty().size }

fun removeAll(names: Set<String>) = apply { names.forEach(::remove) }

fun clear() = apply {
map.clear()
size = 0
}

fun build() =
Headers(
map.mapValuesTo(TreeMap(String.CASE_INSENSITIVE_ORDER)) { (_, values) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

package com.increase.api.core.http

import com.increase.api.core.JsonArray
import com.increase.api.core.JsonBoolean
import com.increase.api.core.JsonMissing
import com.increase.api.core.JsonNull
import com.increase.api.core.JsonNumber
import com.increase.api.core.JsonObject
import com.increase.api.core.JsonString
import com.increase.api.core.JsonValue
import com.increase.api.core.toImmutable

class QueryParams
Expand All @@ -28,6 +36,39 @@ private constructor(
private val map: MutableMap<String, MutableList<String>> = mutableMapOf()
private var size: Int = 0

fun put(key: String, value: JsonValue): Builder = apply {
when (value) {
is JsonMissing,
is JsonNull -> {}
is JsonBoolean -> put(key, value.value.toString())
is JsonNumber -> put(key, value.value.toString())
is JsonString -> put(key, value.value)
is JsonArray ->
put(
key,
value.values
.asSequence()
.mapNotNull {
when (it) {
is JsonMissing,
is JsonNull -> null
is JsonBoolean -> it.value.toString()
is JsonNumber -> it.value.toString()
is JsonString -> it.value
is JsonArray,
is JsonObject ->
throw IllegalArgumentException(
"Cannot comma separate non-primitives in query params"
)
}
}
.joinToString(","),
)
is JsonObject ->
value.values.forEach { (nestedKey, value) -> put("$key.$nestedKey", value) }
}
}

fun put(key: String, value: String) = apply {
map.getOrPut(key) { mutableListOf() }.add(value)
size++
Expand Down
Loading