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.46.1"
".": "0.47.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: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6797b438a8e6a6856e28f4304a5a3c81bb67e74fa2d6fcc20e734880c725295a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-04f02fa57c3ab8d15ecf0a16a41a83814c21cdc2a830fae4d65f1b7b2196d819.yml
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.47.0 (2025-03-10)

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

### Features

* **api:** api update ([#331](https://github.com/orbcorp/orb-java/issues/331)) ([6aea587](https://github.com/orbcorp/orb-java/commit/6aea5874c48a82b78b072e04f5773bb07ed896b6))


### Chores

* **internal:** don't use `JvmOverloads` in interfaces ([19acfcf](https://github.com/orbcorp/orb-java/commit/19acfcfd105bacde55593bc1d6d7b1c9621fc996))
* **internal:** reenable warnings as errors ([#327](https://github.com/orbcorp/orb-java/issues/327)) ([19acfcf](https://github.com/orbcorp/orb-java/commit/19acfcfd105bacde55593bc1d6d7b1c9621fc996))


### Documentation

* document `JsonValue` construction in readme ([#330](https://github.com/orbcorp/orb-java/issues/330)) ([9401e34](https://github.com/orbcorp/orb-java/commit/9401e349149fe4cbc37ee2174e8609cf60d107b0))
* revise readme docs about nested params ([#329](https://github.com/orbcorp/orb-java/issues/329)) ([9a2a812](https://github.com/orbcorp/orb-java/commit/9a2a812cc9aa3b4ab369a28784e0afaaf37badb4))

## 0.46.1 (2025-03-07)

Full Changelog: [v0.46.0...v0.46.1](https://github.com/orbcorp/orb-java/compare/v0.46.0...v0.46.1)
Expand Down
64 changes: 59 additions & 5 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.46.1)
[![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.47.0)

<!-- 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.46.1")
implementation("com.withorb.api:orb-java:0.47.0")
```

### Maven
Expand All @@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:0.46.1")
<dependency>
<groupId>com.withorb.api</groupId>
<artifactId>orb-java</artifactId>
<version>0.46.1</version>
<version>0.47.0</version>
</dependency>
```

Expand Down Expand Up @@ -385,9 +385,24 @@ CustomerCreateParams params = CustomerCreateParams.builder()
.build();
```

These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods. You can also set undocumented parameters on nested headers, query params, or body classes using the `putAdditionalProperty` method. These properties can be accessed on the built object later using the `_additionalProperties()` method.
These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.

To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](orb-java-core/src/main/kotlin/com/withorb/api/core/JsonValue.kt) object to its setter:
To set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:

```java
import com.withorb.api.core.JsonValue;
import com.withorb.api.models.CustomerCreateParams;

CustomerCreateParams params = CustomerCreateParams.builder()
.billingAddress(CustomerCreateParams.BillingAddress.builder()
.putAdditionalProperty("secretProperty", JsonValue.from("42"))
.build())
.build();
```

These properties can be accessed on the nested built object later using the `_additionalProperties()` method.

To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](orb-java-core/src/main/kotlin/com/withorb/api/core/Values.kt) object to its setter:

```java
import com.withorb.api.core.JsonValue;
Expand All @@ -399,6 +414,45 @@ CustomerCreateParams params = CustomerCreateParams.builder()
.build();
```

The most straightforward way to create a [`JsonValue`](orb-java-core/src/main/kotlin/com/withorb/api/core/Values.kt) is using its `from(...)` method:

```java
import com.withorb.api.core.JsonValue;
import java.util.List;
import java.util.Map;

// Create primitive JSON values
JsonValue nullValue = JsonValue.from(null);
JsonValue booleanValue = JsonValue.from(true);
JsonValue numberValue = JsonValue.from(42);
JsonValue stringValue = JsonValue.from("Hello World!");

// Create a JSON array value equivalent to `["Hello", "World"]`
JsonValue arrayValue = JsonValue.from(List.of(
"Hello", "World"
));

// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`
JsonValue objectValue = JsonValue.from(Map.of(
"a", 1,
"b", 2
));

// Create an arbitrarily nested JSON equivalent to:
// {
// "a": [1, 2],
// "b": [3, 4]
// }
JsonValue complexValue = JsonValue.from(Map.of(
"a", List.of(
1, 2
),
"b", List.of(
3, 4
)
));
```

### Response properties

To access undocumented response properties, call the `_additionalProperties()` method:
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.46.1" // x-release-please-version
version = "0.47.0" // x-release-please-version
}
9 changes: 5 additions & 4 deletions buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ configure<SpotlessExtension> {

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"
"-Xjvm-default=all",
"-Xjdk-release=1.8",
// Suppress deprecation warnings because we may still reference and test deprecated members.
"-Xsuppress-warning=DEPRECATION"
)
jvmTarget.set(JvmTarget.JVM_1_8)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("OVERLOADS_INTERFACE") // See https://youtrack.jetbrains.com/issue/KT-36102

package com.withorb.api.core.http

import com.withorb.api.core.RequestOptions
Expand All @@ -8,18 +6,21 @@ import java.util.concurrent.CompletableFuture

interface HttpClient : AutoCloseable {

@JvmOverloads
fun execute(
request: HttpRequest,
requestOptions: RequestOptions = RequestOptions.none(),
): HttpResponse

@JvmOverloads
fun execute(request: HttpRequest): HttpResponse = execute(request, RequestOptions.none())

fun executeAsync(
request: HttpRequest,
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<HttpResponse>

fun executeAsync(request: HttpRequest): CompletableFuture<HttpResponse> =
executeAsync(request, RequestOptions.none())

/** Overridden from [AutoCloseable] to not have a checked exception in its signature. */
override fun close()
}
Original file line number Diff line number Diff line change
Expand Up @@ -49642,13 +49642,17 @@ private constructor(

/**
* The start date of the adjustment interval. This is the date that the adjustment will
* start affecting prices on the subscription.
* start affecting prices on the subscription. The adjustment will apply to invoice dates
* that overlap with this `start_date`. This `start_date` is treated as inclusive for
* in-advance prices, and exclusive for in-arrears prices.
*/
fun startDate(): StartDate = startDate.getRequired("start_date")

/**
* The end date of the adjustment interval. This is the date that the adjustment will stop
* affecting prices on the subscription.
* affecting prices on the subscription. The adjustment will apply to invoice dates that
* overlap with this `end_date`.This `end_date` is treated as exclusive for in-advance
* prices, and inclusive for in-arrears prices.
*/
fun endDate(): Optional<EndDate> = Optional.ofNullable(endDate.getNullable("end_date"))

Expand All @@ -49659,15 +49663,19 @@ private constructor(

/**
* The start date of the adjustment interval. This is the date that the adjustment will
* start affecting prices on the subscription.
* start affecting prices on the subscription. The adjustment will apply to invoice dates
* that overlap with this `start_date`. This `start_date` is treated as inclusive for
* in-advance prices, and exclusive for in-arrears prices.
*/
@JsonProperty("start_date")
@ExcludeMissing
fun _startDate(): JsonField<StartDate> = startDate

/**
* The end date of the adjustment interval. This is the date that the adjustment will stop
* affecting prices on the subscription.
* affecting prices on the subscription. The adjustment will apply to invoice dates that
* overlap with this `end_date`.This `end_date` is treated as exclusive for in-advance
* prices, and inclusive for in-arrears prices.
*/
@JsonProperty("end_date") @ExcludeMissing fun _endDate(): JsonField<EndDate> = endDate

Expand Down Expand Up @@ -49750,56 +49758,74 @@ private constructor(

/**
* The start date of the adjustment interval. This is the date that the adjustment will
* start affecting prices on the subscription.
* start affecting prices on the subscription. The adjustment will apply to invoice
* dates that overlap with this `start_date`. This `start_date` is treated as inclusive
* for in-advance prices, and exclusive for in-arrears prices.
*/
fun startDate(startDate: StartDate) = startDate(JsonField.of(startDate))

/**
* The start date of the adjustment interval. This is the date that the adjustment will
* start affecting prices on the subscription.
* start affecting prices on the subscription. The adjustment will apply to invoice
* dates that overlap with this `start_date`. This `start_date` is treated as inclusive
* for in-advance prices, and exclusive for in-arrears prices.
*/
fun startDate(startDate: JsonField<StartDate>) = apply { this.startDate = startDate }

/**
* The start date of the adjustment interval. This is the date that the adjustment will
* start affecting prices on the subscription.
* start affecting prices on the subscription. The adjustment will apply to invoice
* dates that overlap with this `start_date`. This `start_date` is treated as inclusive
* for in-advance prices, and exclusive for in-arrears prices.
*/
fun startDate(dateTime: OffsetDateTime) = startDate(StartDate.ofDateTime(dateTime))

/**
* The start date of the adjustment interval. This is the date that the adjustment will
* start affecting prices on the subscription.
* start affecting prices on the subscription. The adjustment will apply to invoice
* dates that overlap with this `start_date`. This `start_date` is treated as inclusive
* for in-advance prices, and exclusive for in-arrears prices.
*/
fun startDate(billingCycleRelative: BillingCycleRelativeDate) =
startDate(StartDate.ofBillingCycleRelative(billingCycleRelative))

/**
* The end date of the adjustment interval. This is the date that the adjustment will
* stop affecting prices on the subscription.
* stop affecting prices on the subscription. The adjustment will apply to invoice dates
* that overlap with this `end_date`.This `end_date` is treated as exclusive for
* in-advance prices, and inclusive for in-arrears prices.
*/
fun endDate(endDate: EndDate?) = endDate(JsonField.ofNullable(endDate))

/**
* The end date of the adjustment interval. This is the date that the adjustment will
* stop affecting prices on the subscription.
* stop affecting prices on the subscription. The adjustment will apply to invoice dates
* that overlap with this `end_date`.This `end_date` is treated as exclusive for
* in-advance prices, and inclusive for in-arrears prices.
*/
fun endDate(endDate: Optional<EndDate>) = endDate(endDate.getOrNull())

/**
* The end date of the adjustment interval. This is the date that the adjustment will
* stop affecting prices on the subscription.
* stop affecting prices on the subscription. The adjustment will apply to invoice dates
* that overlap with this `end_date`.This `end_date` is treated as exclusive for
* in-advance prices, and inclusive for in-arrears prices.
*/
fun endDate(endDate: JsonField<EndDate>) = apply { this.endDate = endDate }

/**
* The end date of the adjustment interval. This is the date that the adjustment will
* stop affecting prices on the subscription.
* stop affecting prices on the subscription. The adjustment will apply to invoice dates
* that overlap with this `end_date`.This `end_date` is treated as exclusive for
* in-advance prices, and inclusive for in-arrears prices.
*/
fun endDate(dateTime: OffsetDateTime) = endDate(EndDate.ofDateTime(dateTime))

/**
* The end date of the adjustment interval. This is the date that the adjustment will
* stop affecting prices on the subscription.
* stop affecting prices on the subscription. The adjustment will apply to invoice dates
* that overlap with this `end_date`.This `end_date` is treated as exclusive for
* in-advance prices, and inclusive for in-arrears prices.
*/
fun endDate(billingCycleRelative: BillingCycleRelativeDate) =
endDate(EndDate.ofBillingCycleRelative(billingCycleRelative))
Expand Down Expand Up @@ -51651,7 +51677,9 @@ private constructor(

/**
* The start date of the adjustment interval. This is the date that the adjustment will
* start affecting prices on the subscription.
* start affecting prices on the subscription. The adjustment will apply to invoice dates
* that overlap with this `start_date`. This `start_date` is treated as inclusive for
* in-advance prices, and exclusive for in-arrears prices.
*/
@JsonDeserialize(using = StartDate.Deserializer::class)
@JsonSerialize(using = StartDate.Serializer::class)
Expand Down Expand Up @@ -51795,7 +51823,9 @@ private constructor(

/**
* The end date of the adjustment interval. This is the date that the adjustment will stop
* affecting prices on the subscription.
* affecting prices on the subscription. The adjustment will apply to invoice dates that
* overlap with this `end_date`.This `end_date` is treated as exclusive for in-advance
* prices, and inclusive for in-arrears prices.
*/
@JsonDeserialize(using = EndDate.Deserializer::class)
@JsonSerialize(using = EndDate.Serializer::class)
Expand Down
Loading
Loading