Skip to content

Commit b06d37a

Browse files
feat(api): api update (#92)
1 parent 6a7b7b8 commit b06d37a

7 files changed

Lines changed: 31 additions & 41 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 95
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1a0cb9f84cf6b6342b82c87ecdcba968405aac1dfb0c78eaf055a44fe15cab2c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-97c8d75c5095cb134ab45f92a057797013d174324268fcf1ba750c5ebcd9b3e4.yml

orb-java-core/src/main/kotlin/com/withorb/api/core/Utils.kt

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ import com.withorb.api.errors.OrbInvalidDataException
99
import java.util.Collections
1010

1111
@JvmSynthetic
12-
internal fun <T : Any> T?.getOrThrow(name: String): T {
13-
if (this == null) {
14-
throw OrbInvalidDataException("'${name}' is not present")
15-
}
16-
17-
return this
18-
}
12+
internal fun <T : Any> T?.getOrThrow(name: String): T =
13+
this ?: throw OrbInvalidDataException("`${name}` is not present")
1914

2015
@JvmSynthetic
2116
internal fun <T> List<T>.toUnmodifiable(): List<T> {
@@ -44,18 +39,4 @@ internal fun <K, V> ListMultimap<K, V>.toUnmodifiable(): ListMultimap<K, V> {
4439
return Multimaps.unmodifiableListMultimap(this)
4540
}
4641

47-
@JvmSynthetic
48-
internal fun ListMultimap<String, String>.getRequiredHeader(header: String): String {
49-
val value =
50-
entries()
51-
.stream()
52-
.filter { entry -> entry.key.equals(header, ignoreCase = true) }
53-
.map { entry -> entry.value }
54-
.findFirst()
55-
if (!value.isPresent) {
56-
throw OrbInvalidDataException("Could not find $header header")
57-
}
58-
return value.get()
59-
}
60-
6142
internal interface Enum

orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.withorb.api.core.http
22

3-
import com.google.common.util.concurrent.MoreExecutors
43
import com.withorb.api.core.RequestOptions
54
import com.withorb.api.errors.OrbIoException
65
import java.io.IOException
@@ -116,8 +115,10 @@ private constructor(
116115
executeWithRetries(request, requestOptions)
117116
}
118117
},
119-
MoreExecutors.directExecutor()
120-
)
118+
) {
119+
// Run in the same thread.
120+
it.run()
121+
}
121122
.thenCompose(Function.identity())
122123
}
123124

orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsync.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ interface SubscriptionServiceAsync {
6363
* being created. This is useful when a customer has prices that differ from the default prices
6464
* for a specific plan.
6565
*
66-
* :::info This feature is only available for accounts that have migrated off of legacy
67-
* subscription overrides. :::
66+
* :::info This feature is only available for accounts that have migrated to Subscription
67+
* Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your
68+
* [Plans page](https://app.withorb.com/plans) :::
6869
*
6970
* ### Adding Prices
7071
*
@@ -689,8 +690,9 @@ interface SubscriptionServiceAsync {
689690
* you schedule the plan change. This is useful when a customer has prices that differ from the
690691
* default prices for a specific plan.
691692
*
692-
* :::info This feature is only available for accounts that have migrated off of legacy
693-
* subscription overrides. :::
693+
* :::info This feature is only available for accounts that have migrated to Subscription
694+
* Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your
695+
* [Plans page](https://app.withorb.com/plans) :::
694696
*
695697
* ### Adding Prices
696698
*

orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncImpl.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ constructor(
7878
* being created. This is useful when a customer has prices that differ from the default prices
7979
* for a specific plan.
8080
*
81-
* :::info This feature is only available for accounts that have migrated off of legacy
82-
* subscription overrides. :::
81+
* :::info This feature is only available for accounts that have migrated to Subscription
82+
* Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your
83+
* [Plans page](https://app.withorb.com/plans) :::
8384
*
8485
* ### Adding Prices
8586
*
@@ -911,8 +912,9 @@ constructor(
911912
* you schedule the plan change. This is useful when a customer has prices that differ from the
912913
* default prices for a specific plan.
913914
*
914-
* :::info This feature is only available for accounts that have migrated off of legacy
915-
* subscription overrides. :::
915+
* :::info This feature is only available for accounts that have migrated to Subscription
916+
* Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your
917+
* [Plans page](https://app.withorb.com/plans) :::
916918
*
917919
* ### Adding Prices
918920
*

orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionService.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ interface SubscriptionService {
6262
* being created. This is useful when a customer has prices that differ from the default prices
6363
* for a specific plan.
6464
*
65-
* :::info This feature is only available for accounts that have migrated off of legacy
66-
* subscription overrides. :::
65+
* :::info This feature is only available for accounts that have migrated to Subscription
66+
* Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your
67+
* [Plans page](https://app.withorb.com/plans) :::
6768
*
6869
* ### Adding Prices
6970
*
@@ -688,8 +689,9 @@ interface SubscriptionService {
688689
* you schedule the plan change. This is useful when a customer has prices that differ from the
689690
* default prices for a specific plan.
690691
*
691-
* :::info This feature is only available for accounts that have migrated off of legacy
692-
* subscription overrides. :::
692+
* :::info This feature is only available for accounts that have migrated to Subscription
693+
* Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your
694+
* [Plans page](https://app.withorb.com/plans) :::
693695
*
694696
* ### Adding Prices
695697
*

orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionServiceImpl.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ constructor(
7777
* being created. This is useful when a customer has prices that differ from the default prices
7878
* for a specific plan.
7979
*
80-
* :::info This feature is only available for accounts that have migrated off of legacy
81-
* subscription overrides. :::
80+
* :::info This feature is only available for accounts that have migrated to Subscription
81+
* Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your
82+
* [Plans page](https://app.withorb.com/plans) :::
8283
*
8384
* ### Adding Prices
8485
*
@@ -901,8 +902,9 @@ constructor(
901902
* you schedule the plan change. This is useful when a customer has prices that differ from the
902903
* default prices for a specific plan.
903904
*
904-
* :::info This feature is only available for accounts that have migrated off of legacy
905-
* subscription overrides. :::
905+
* :::info This feature is only available for accounts that have migrated to Subscription
906+
* Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your
907+
* [Plans page](https://app.withorb.com/plans) :::
906908
*
907909
* ### Adding Prices
908910
*

0 commit comments

Comments
 (0)