Skip to content
  •  
  •  
  •  
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.49.0"
".": "0.49.1"
}
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.49.1 (2025-03-18)

Full Changelog: [v0.49.0...v0.49.1](https://github.com/orbcorp/orb-java/compare/v0.49.0...v0.49.1)

### Bug Fixes

* **client:** support kotlin 1.8 runtime ([#352](https://github.com/orbcorp/orb-java/issues/352)) ([55893cb](https://github.com/orbcorp/orb-java/commit/55893cbb45d77cfff23961bffdd18d43423f8aee))


### Chores

* **internal:** add generated comment ([#346](https://github.com/orbcorp/orb-java/issues/346)) ([670dae5](https://github.com/orbcorp/orb-java/commit/670dae56117f901c72b1b925a3e350e2b59d2dc4))
* **internal:** add some tests for union classes ([#351](https://github.com/orbcorp/orb-java/issues/351)) ([8daea2a](https://github.com/orbcorp/orb-java/commit/8daea2a50c34866564f1eb9e04cdae4bc6bbd2a2))
* **internal:** delete duplicate tests ([a2ae257](https://github.com/orbcorp/orb-java/commit/a2ae25777f691b41232cb8a6e13aa8a502da1c8c))
* **internal:** generate more tests ([399f1ce](https://github.com/orbcorp/orb-java/commit/399f1ce0a2efcc7846cc0c4783178f8529a36207))
* **internal:** make test classes internal ([#345](https://github.com/orbcorp/orb-java/issues/345)) ([8566c48](https://github.com/orbcorp/orb-java/commit/8566c482616da4e427c0d1625f0585b3d796a628))
* **internal:** refactor query param serialization impl and tests ([#348](https://github.com/orbcorp/orb-java/issues/348)) ([15e112d](https://github.com/orbcorp/orb-java/commit/15e112d3c1450ddfaa329cd921f052e3f34f37dc))
* **internal:** refactor some test assertions ([a2ae257](https://github.com/orbcorp/orb-java/commit/a2ae25777f691b41232cb8a6e13aa8a502da1c8c))
* **internal:** reformat some tests ([#350](https://github.com/orbcorp/orb-java/issues/350)) ([399f1ce](https://github.com/orbcorp/orb-java/commit/399f1ce0a2efcc7846cc0c4783178f8529a36207))
* **internal:** rename `getPathParam` ([#349](https://github.com/orbcorp/orb-java/issues/349)) ([a2ae257](https://github.com/orbcorp/orb-java/commit/a2ae25777f691b41232cb8a6e13aa8a502da1c8c))
* **internal:** reorder some params methodsc ([a2ae257](https://github.com/orbcorp/orb-java/commit/a2ae25777f691b41232cb8a6e13aa8a502da1c8c))


### Documentation

* add `build` method comments ([#347](https://github.com/orbcorp/orb-java/issues/347)) ([0dcf1be](https://github.com/orbcorp/orb-java/commit/0dcf1bebf6db9e9c5f2e0d3606a1acab2b85adce))
* deduplicate and refine comments ([#343](https://github.com/orbcorp/orb-java/issues/343)) ([483df7c](https://github.com/orbcorp/orb-java/commit/483df7c06115b3a5584b939e1f640a1b618abd79))

## 0.49.0 (2025-03-14)

Full Changelog: [v0.48.0...v0.49.0](https://github.com/orbcorp/orb-java/compare/v0.48.0...v0.49.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.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.49.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.49.1)

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

Expand All @@ -19,7 +19,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.witho
### Gradle

```kotlin
implementation("com.withorb.api:orb-java:0.49.0")
implementation("com.withorb.api:orb-java:0.49.1")
```

### Maven
Expand All @@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:0.49.0")
<dependency>
<groupId>com.withorb.api</groupId>
<artifactId>orb-java</artifactId>
<version>0.49.0</version>
<version>0.49.1</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.withorb.api"
version = "0.49.0" // x-release-please-version
version = "0.49.1" // x-release-please-version
}
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
`kotlin-dsl`
kotlin("jvm") version "2.1.10"
kotlin("jvm") version "1.9.20"
id("com.vanniktech.maven.publish") version "0.28.0"
}

Expand All @@ -11,6 +11,6 @@ repositories {

dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.10")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/orb.java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<JavaCompile>().configureEach {
Expand Down
25 changes: 13 additions & 12 deletions buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("orb.java")
Expand All @@ -11,25 +11,26 @@ kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

configure<SpotlessExtension> {
kotlin {
ktfmt().kotlinlangStyle()
toggleOffOn()
}
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
allWarningsAsErrors = true
freeCompilerArgs = listOf(
"-Xjvm-default=all",
"-Xjdk-release=1.8",
// Suppress deprecation warnings because we may still reference and test deprecated members.
"-Xsuppress-warning=DEPRECATION"
// TODO: Replace with `-Xsuppress-warning=DEPRECATION` once we use Kotlin compiler 2.1.0+.
"-nowarn",
)
jvmTarget.set(JvmTarget.JVM_1_8)
languageVersion.set(KotlinVersion.KOTLIN_1_8)
apiVersion.set(KotlinVersion.KOTLIN_1_8)
coreLibrariesVersion = "1.8.0"
}
}

configure<SpotlessExtension> {
kotlin {
ktfmt().kotlinlangStyle()
toggleOffOn()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,17 @@ class OrbOkHttpClient private constructor() {
clientOptions.webhookSecret(webhookSecret)
}

/** Alias for calling [Builder.webhookSecret] with `webhookSecret.orElse(null)`. */
fun webhookSecret(webhookSecret: Optional<String>) =
webhookSecret(webhookSecret.getOrNull())

fun fromEnv() = apply { clientOptions.fromEnv() }

/**
* Returns an immutable instance of [OrbClient].
*
* Further updates to this [Builder] will not mutate the returned instance.
*/
fun build(): OrbClient =
OrbClientImpl(
clientOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,17 @@ class OrbOkHttpClientAsync private constructor() {
clientOptions.webhookSecret(webhookSecret)
}

/** Alias for calling [Builder.webhookSecret] with `webhookSecret.orElse(null)`. */
fun webhookSecret(webhookSecret: Optional<String>) =
webhookSecret(webhookSecret.getOrNull())

fun fromEnv() = apply { clientOptions.fromEnv() }

/**
* Returns an immutable instance of [OrbClientAsync].
*
* Further updates to this [Builder] will not mutate the returned instance.
*/
fun build(): OrbClientAsync =
OrbClientAsyncImpl(
clientOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ private constructor(

fun webhookSecret(webhookSecret: String?) = apply { this.webhookSecret = webhookSecret }

/** Alias for calling [Builder.webhookSecret] with `webhookSecret.orElse(null)`. */
fun webhookSecret(webhookSecret: Optional<String>) =
webhookSecret(webhookSecret.getOrNull())

Expand Down Expand Up @@ -188,6 +189,19 @@ private constructor(
System.getenv("ORB_WEBHOOK_SECRET")?.let { webhookSecret(it) }
}

/**
* Returns an immutable instance of [ClientOptions].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
* .httpClient()
* .apiKey()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
fun build(): ClientOptions {
val httpClient = checkRequired("httpClient", httpClient)
val apiKey = checkRequired("apiKey", apiKey)
Expand Down
38 changes: 8 additions & 30 deletions orb-java-core/src/main/kotlin/com/withorb/api/core/Timeout.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,7 @@ private constructor(
*/
fun connect(connect: Duration?) = apply { this.connect = connect }

/**
* The maximum time allowed to establish a connection with a host.
*
* A value of [Duration.ZERO] means there's no timeout.
*
* Defaults to `Duration.ofMinutes(1)`.
*/
/** Alias for calling [Builder.connect] with `connect.orElse(null)`. */
fun connect(connect: Optional<Duration>) = connect(connect.getOrNull())

/**
Expand All @@ -108,13 +102,7 @@ private constructor(
*/
fun read(read: Duration?) = apply { this.read = read }

/**
* The maximum time allowed between two data packets when waiting for the server’s response.
*
* A value of [Duration.ZERO] means there's no timeout.
*
* Defaults to `request()`.
*/
/** Alias for calling [Builder.read] with `read.orElse(null)`. */
fun read(read: Optional<Duration>) = read(read.getOrNull())

/**
Expand All @@ -126,13 +114,7 @@ private constructor(
*/
fun write(write: Duration?) = apply { this.write = write }

/**
* The maximum time allowed between two data packets when sending the request to the server.
*
* A value of [Duration.ZERO] means there's no timeout.
*
* Defaults to `request()`.
*/
/** Alias for calling [Builder.write] with `write.orElse(null)`. */
fun write(write: Optional<Duration>) = write(write.getOrNull())

/**
Expand All @@ -147,18 +129,14 @@ private constructor(
*/
fun request(request: Duration?) = apply { this.request = request }

/** Alias for calling [Builder.request] with `request.orElse(null)`. */
fun request(request: Optional<Duration>) = request(request.getOrNull())

/**
* The maximum time allowed for a complete HTTP call, not including retries.
* Returns an immutable instance of [Timeout].
*
* This includes resolving DNS, connecting, writing the request body, server processing, as
* well as reading the response body.
*
* A value of [Duration.ZERO] means there's no timeout.
*
* Defaults to `Duration.ofMinutes(1)`.
* Further updates to this [Builder] will not mutate the returned instance.
*/
fun request(request: Optional<Duration>) = request(request.getOrNull())

fun build(): Timeout = Timeout(connect, read, write, request)
}

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

package com.withorb.api.core.http

import com.withorb.api.core.toImmutable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}

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

Expand Down
Loading
Loading