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.14.0"
".": "0.15.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-77f4e8cf0fc3b3f18c894408f322af7988ae90606235fe5058442409142a33e1.yml
configured_endpoints: 101
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c5fe55b056b10d6581c877beb0639a8f0a623e52fd9778e56fab8a86439bd31b.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.15.0 (2025-01-02)

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

### Features

* **api:** api update ([#161](https://github.com/orbcorp/orb-java/issues/161)) ([d035cba](https://github.com/orbcorp/orb-java/commit/d035cbaf1d1d98117ed800b746e969b1c6b368cc))

## 0.14.0 (2024-12-23)

Full Changelog: [v0.13.0...v0.14.0](https://github.com/orbcorp/orb-java/compare/v0.13.0...v0.14.0)
Expand Down
8 changes: 4 additions & 4 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.14.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.15.0)

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

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

```kotlin
implementation("com.withorb.api:orb-java:0.14.0")
implementation("com.withorb.api:orb-java:0.15.0")
```

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

Expand Down Expand Up @@ -346,7 +346,7 @@ This library is typed for convenient access to the documented API. If you need t

To make requests using undocumented parameters, you can provide or override parameters on the params object while building it.

```kotlin
```java
FooCreateParams address = FooCreateParams.builder()
.id("my_id")
.putAdditionalProperty("secret_prop", JsonValue.from("hello"))
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "com.withorb.api"
version = "0.14.0" // x-release-please-version
version = "0.15.0" // x-release-please-version
}


Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class OrbOkHttpClient private constructor() {

fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class OrbOkHttpClientAsync private constructor() {

fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.withorb.api.services.blocking.AlertService
import com.withorb.api.services.blocking.CouponService
import com.withorb.api.services.blocking.CreditNoteService
import com.withorb.api.services.blocking.CustomerService
import com.withorb.api.services.blocking.DimensionalPriceGroupService
import com.withorb.api.services.blocking.EventService
import com.withorb.api.services.blocking.InvoiceLineItemService
import com.withorb.api.services.blocking.InvoiceService
Expand All @@ -15,6 +16,7 @@ import com.withorb.api.services.blocking.PlanService
import com.withorb.api.services.blocking.PriceService
import com.withorb.api.services.blocking.SubscriptionService
import com.withorb.api.services.blocking.TopLevelService
import com.withorb.api.services.blocking.WebhookService

interface OrbClient {

Expand Down Expand Up @@ -46,5 +48,7 @@ interface OrbClient {

fun alerts(): AlertService

fun dimensionalPriceGroups(): DimensionalPriceGroupService

fun webhooks(): WebhookService
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.withorb.api.services.async.AlertServiceAsync
import com.withorb.api.services.async.CouponServiceAsync
import com.withorb.api.services.async.CreditNoteServiceAsync
import com.withorb.api.services.async.CustomerServiceAsync
import com.withorb.api.services.async.DimensionalPriceGroupServiceAsync
import com.withorb.api.services.async.EventServiceAsync
import com.withorb.api.services.async.InvoiceLineItemServiceAsync
import com.withorb.api.services.async.InvoiceServiceAsync
Expand Down Expand Up @@ -45,4 +46,6 @@ interface OrbClientAsync {
fun subscriptions(): SubscriptionServiceAsync

fun alerts(): AlertServiceAsync

fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import com.withorb.api.services.async.CreditNoteServiceAsync
import com.withorb.api.services.async.CreditNoteServiceAsyncImpl
import com.withorb.api.services.async.CustomerServiceAsync
import com.withorb.api.services.async.CustomerServiceAsyncImpl
import com.withorb.api.services.async.DimensionalPriceGroupServiceAsync
import com.withorb.api.services.async.DimensionalPriceGroupServiceAsyncImpl
import com.withorb.api.services.async.EventServiceAsync
import com.withorb.api.services.async.EventServiceAsyncImpl
import com.withorb.api.services.async.InvoiceLineItemServiceAsync
Expand Down Expand Up @@ -95,6 +97,10 @@ constructor(
AlertServiceAsyncImpl(clientOptionsWithUserAgent)
}

private val dimensionalPriceGroups: DimensionalPriceGroupServiceAsync by lazy {
DimensionalPriceGroupServiceAsyncImpl(clientOptionsWithUserAgent)
}

override fun sync(): OrbClient = sync

override fun topLevel(): TopLevelServiceAsync = topLevel
Expand Down Expand Up @@ -122,4 +128,7 @@ constructor(
override fun subscriptions(): SubscriptionServiceAsync = subscriptions

override fun alerts(): AlertServiceAsync = alerts

override fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync =
dimensionalPriceGroups
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import com.withorb.api.services.blocking.CreditNoteService
import com.withorb.api.services.blocking.CreditNoteServiceImpl
import com.withorb.api.services.blocking.CustomerService
import com.withorb.api.services.blocking.CustomerServiceImpl
import com.withorb.api.services.blocking.DimensionalPriceGroupService
import com.withorb.api.services.blocking.DimensionalPriceGroupServiceImpl
import com.withorb.api.services.blocking.WebhookService
import com.withorb.api.services.blocking.WebhookServiceImpl
import com.withorb.api.services.blocking.EventService
import com.withorb.api.services.blocking.EventServiceImpl
import com.withorb.api.services.blocking.InvoiceLineItemService
Expand Down Expand Up @@ -83,6 +87,10 @@ constructor(

private val alerts: AlertService by lazy { AlertServiceImpl(clientOptionsWithUserAgent) }

private val dimensionalPriceGroups: DimensionalPriceGroupService by lazy {
DimensionalPriceGroupServiceImpl(clientOptionsWithUserAgent)
}

private val webhooks: WebhookService by lazy { WebhookServiceImpl(clientOptions) }

override fun async(): OrbClientAsync = async
Expand Down Expand Up @@ -113,5 +121,7 @@ constructor(

override fun alerts(): AlertService = alerts

override fun dimensionalPriceGroups(): DimensionalPriceGroupService = dimensionalPriceGroups

override fun webhooks(): WebhookService = webhooks
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private constructor(

fun apiKey(apiKey: String) = apply { this.apiKey = apiKey }

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

fun fromEnv() = apply {
System.getenv("ORB_API_KEY")?.let { apiKey(it) }
Expand Down
4 changes: 3 additions & 1 deletion orb-java-core/src/main/kotlin/com/withorb/api/core/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ internal fun <T> List<T>.toImmutable(): List<T> =

@JvmSynthetic
internal fun <K, V> Map<K, V>.toImmutable(): Map<K, V> =
if (isEmpty()) Collections.emptyMap() else Collections.unmodifiableMap(toMap())
if (isEmpty()) immutableEmptyMap() else Collections.unmodifiableMap(toMap())

@JvmSynthetic internal fun <K, V> immutableEmptyMap(): Map<K, V> = Collections.emptyMap()

@JvmSynthetic
internal fun <K : Comparable<K>, V> SortedMap<K, V>.toImmutable(): SortedMap<K, V> =
Expand Down
11 changes: 7 additions & 4 deletions orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ package com.withorb.api.errors

import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.fasterxml.jackson.annotation.JsonCreator
import com.withorb.api.core.ExcludeMissing
import com.withorb.api.core.JsonValue
import com.withorb.api.core.NoAutoDetect
import com.withorb.api.core.immutableEmptyMap
import com.withorb.api.core.toImmutable
import java.util.Objects

@JsonDeserialize(builder = OrbError.Builder::class)
@NoAutoDetect
class OrbError
@JsonCreator
private constructor(
@JsonAnyGetter
@ExcludeMissing
@JsonAnySetter
@get:JvmName("additionalProperties")
val additionalProperties: Map<String, JsonValue>,
val additionalProperties: Map<String, JsonValue> = immutableEmptyMap(),
) {

fun toBuilder() = Builder().from(this)
Expand All @@ -40,7 +44,6 @@ private constructor(
putAllAdditionalProperties(additionalProperties)
}

@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
additionalProperties.put(key, value)
}
Expand Down
Loading
Loading