Skip to content

Commit 28f0892

Browse files
authored
Merge pull request #60 from orbcorp/release-please--branches--main--changes--next
release: 0.1.0-alpha.7
2 parents c38d281 + 75124f3 commit 28f0892

File tree

125 files changed

+140148
-26508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+140148
-26508
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.6"
2+
".": "0.1.0-alpha.7"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 93
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-5b28e83c3230be7d858ce20741c7b5debdad3e7720e2fa6e3a2d1774ca02a337.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-2909e111b2e1a19626356bae22b7ef7ed276e7e33b939a2b8e164ccb1ec1bf40.yml

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Changelog
22

3+
## 0.1.0-alpha.7 (2024-09-26)
4+
5+
Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/orbcorp/orb-java/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
6+
7+
### Features
8+
9+
* **api:** OpenAPI spec update via Stainless API ([#59](https://github.com/orbcorp/orb-java/issues/59)) ([8e8574c](https://github.com/orbcorp/orb-java/commit/8e8574cb159e45ab036088048a1362a6a8c32cc2))
10+
* **api:** OpenAPI spec update via Stainless API ([#61](https://github.com/orbcorp/orb-java/issues/61)) ([b48f9fe](https://github.com/orbcorp/orb-java/commit/b48f9fe87aae83b2bb028a4c8216a66f26af8801))
11+
* **api:** OpenAPI spec update via Stainless API ([#63](https://github.com/orbcorp/orb-java/issues/63)) ([fd13223](https://github.com/orbcorp/orb-java/commit/fd13223cd190ecee0312f5d64d74522db567d864))
12+
* **api:** OpenAPI spec update via Stainless API ([#67](https://github.com/orbcorp/orb-java/issues/67)) ([afffd96](https://github.com/orbcorp/orb-java/commit/afffd968e135d74d899c0377b0f6e5bf1787ae33))
13+
* **api:** OpenAPI spec update via Stainless API ([#68](https://github.com/orbcorp/orb-java/issues/68)) ([bd66065](https://github.com/orbcorp/orb-java/commit/bd6606510bf4dad9be78d019b9130542d0a9a532))
14+
* **api:** OpenAPI spec update via Stainless API ([#70](https://github.com/orbcorp/orb-java/issues/70)) ([8ab0aab](https://github.com/orbcorp/orb-java/commit/8ab0aab0ebea8a4d147a9c93b0e30917192743a6))
15+
* **api:** OpenAPI spec update via Stainless API ([#76](https://github.com/orbcorp/orb-java/issues/76)) ([5013205](https://github.com/orbcorp/orb-java/commit/50132057be8af15e443e6c6ee6a3828d24b888c0))
16+
* **client:** added structured fields to errors ([#65](https://github.com/orbcorp/orb-java/issues/65)) ([e6226f9](https://github.com/orbcorp/orb-java/commit/e6226f9a57e42c1786353757aca5b32744a24ffb))
17+
18+
19+
### Chores
20+
21+
* **api:** rename `void` to `void_invoice` in Java SDK ([#72](https://github.com/orbcorp/orb-java/issues/72)) ([61d300a](https://github.com/orbcorp/orb-java/commit/61d300a474bca6fc47658bb3daa9dc7f1de44a16))
22+
* **docs:** internal update ([#74](https://github.com/orbcorp/orb-java/issues/74)) ([577588d](https://github.com/orbcorp/orb-java/commit/577588daa262f51547de5eb6785226fdca41be2b))
23+
* **docs:** internal update ([#75](https://github.com/orbcorp/orb-java/issues/75)) ([6905912](https://github.com/orbcorp/orb-java/commit/69059129d10672b1806b2288e044ff986c53d0c8))
24+
* **internal:** codegen related update ([#71](https://github.com/orbcorp/orb-java/issues/71)) ([99ddc03](https://github.com/orbcorp/orb-java/commit/99ddc031f02c7fe5648bfad4b6de0481864707cc))
25+
* **internal:** codegen related update ([#73](https://github.com/orbcorp/orb-java/issues/73)) ([5021325](https://github.com/orbcorp/orb-java/commit/50213258784197ba307bfe34f7c82a8ee821439a))
26+
* **internal:** fix lint warning for isPresent ([#66](https://github.com/orbcorp/orb-java/issues/66)) ([ff81eb6](https://github.com/orbcorp/orb-java/commit/ff81eb6ab227a308b45b0fa961ce3a8759826fdf))
27+
28+
29+
### Documentation
30+
31+
* adjust additional properties example ([#64](https://github.com/orbcorp/orb-java/issues/64)) ([f200314](https://github.com/orbcorp/orb-java/commit/f20031470e553f4e414375e536e1366c2316dfb2))
32+
333
## 0.1.0-alpha.6 (2024-09-06)
434

535
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/orbcorp/orb-java/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![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.1.0-alpha.6)
5+
[![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.1.0-alpha.7)
66

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

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

2727
```kotlin
28-
implementation("com.withorb.api:orb-java:0.1.0-alpha.6")
28+
implementation("com.withorb.api:orb-java:0.1.0-alpha.7")
2929
```
3030

3131
#### Maven
@@ -34,7 +34,7 @@ implementation("com.withorb.api:orb-java:0.1.0-alpha.6")
3434
<dependency>
3535
<groupId>com.withorb.api</groupId>
3636
<artifactId>orb-java</artifactId>
37-
<version>0.1.0-alpha.6</version>
37+
<version>0.1.0-alpha.7</version>
3838
</dependency>
3939
```
4040

@@ -166,7 +166,7 @@ if (field.isMissing()) {
166166
Sometimes, the server response may include additional properties that are not yet available in this library's types. You can access them using the model's `_additionalProperties` method:
167167

168168
```java
169-
JsonValue secret = customer._additionalProperties().get("secret_field");
169+
JsonValue secret = amountDiscount._additionalProperties().get("secret_field");
170170
```
171171

172172
---

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
allprojects {
66
group = "com.withorb.api"
7-
version = "0.1.0-alpha.6" // x-release-please-version
7+
version = "0.1.0-alpha.7" // x-release-please-version
88
}
99

1010

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@ private constructor(
4040

4141
maybeAddIdempotencyHeader(request)
4242

43+
// Don't send the current retry count in the headers if the caller set their own value.
44+
val shouldSendRetryCount = !request.headers.containsKey("x-stainless-retry-count")
45+
4346
var retries = 0
4447

4548
while (true) {
49+
if (shouldSendRetryCount) {
50+
setRetryCountHeader(request, retries)
51+
}
52+
4653
val response =
4754
try {
4855
val response = httpClient.execute(request, requestOptions)
@@ -74,10 +81,21 @@ private constructor(
7481

7582
maybeAddIdempotencyHeader(request)
7683

84+
// Don't send the current retry count in the headers if the caller set their own value.
85+
val shouldSendRetryCount = !request.headers.containsKey("x-stainless-retry-count")
86+
7787
var retries = 0
7888

79-
fun wrap(future: CompletableFuture<HttpResponse>): CompletableFuture<HttpResponse> {
80-
return future
89+
fun executeWithRetries(
90+
request: HttpRequest,
91+
requestOptions: RequestOptions,
92+
): CompletableFuture<HttpResponse> {
93+
if (shouldSendRetryCount) {
94+
setRetryCountHeader(request, retries)
95+
}
96+
97+
return httpClient
98+
.executeAsync(request, requestOptions)
8199
.handleAsync(
82100
fun(
83101
response: HttpResponse?,
@@ -97,15 +115,15 @@ private constructor(
97115

98116
val backoffMillis = getRetryBackoffMillis(retries, response)
99117
return sleepAsync(backoffMillis.toMillis()).thenCompose {
100-
wrap(httpClient.executeAsync(request, requestOptions))
118+
executeWithRetries(request, requestOptions)
101119
}
102120
},
103121
MoreExecutors.directExecutor()
104122
)
105123
.thenCompose(Function.identity())
106124
}
107125

108-
return wrap(httpClient.executeAsync(request, requestOptions))
126+
return executeWithRetries(request, requestOptions)
109127
}
110128

111129
override fun close() {
@@ -118,6 +136,11 @@ private constructor(
118136
return request.body?.repeatable() ?: true
119137
}
120138

139+
private fun setRetryCountHeader(request: HttpRequest, retries: Int) {
140+
request.headers.removeAll("x-stainless-retry-count")
141+
request.headers.put("x-stainless-retry-count", retries.toString())
142+
}
143+
121144
private fun idempotencyKey(): String = "stainless-java-retry-${UUID.randomUUID()}"
122145

123146
private fun maybeAddIdempotencyHeader(request: HttpRequest) {

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ package com.withorb.api.errors
22

33
import com.google.common.collect.ListMultimap
44

5-
class BadRequestException
6-
constructor(
5+
class BadRequestException(
76
headers: ListMultimap<String, String>,
8-
private val error: OrbError,
9-
) : OrbServiceException(headers, "${error}") {
10-
override fun statusCode(): Int = 400
11-
12-
fun error(): OrbError = error
13-
}
7+
body: String,
8+
error: OrbError,
9+
) : OrbServiceException(400, headers, body, error)

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ package com.withorb.api.errors
22

33
import com.google.common.collect.ListMultimap
44

5-
class InternalServerException
6-
constructor(
7-
private val statusCode: Int,
5+
class InternalServerException(
6+
statusCode: Int,
87
headers: ListMultimap<String, String>,
9-
private val error: OrbError,
10-
) : OrbServiceException(headers, "${error}") {
11-
override fun statusCode(): Int = statusCode
12-
13-
fun error(): OrbError = error
14-
}
8+
body: String,
9+
error: OrbError,
10+
) : OrbServiceException(statusCode, headers, body, error)

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ package com.withorb.api.errors
22

33
import com.google.common.collect.ListMultimap
44

5-
class NotFoundException
6-
constructor(
5+
class NotFoundException(
76
headers: ListMultimap<String, String>,
8-
private val error: OrbError,
9-
) : OrbServiceException(headers, "${error}") {
10-
override fun statusCode(): Int = 404
11-
12-
fun error(): OrbError = error
13-
}
7+
body: String,
8+
error: OrbError,
9+
) : OrbServiceException(404, headers, body, error)

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ import com.google.common.collect.ListMultimap
55
abstract class OrbServiceException
66
@JvmOverloads
77
constructor(
8+
private val statusCode: Int,
89
private val headers: ListMultimap<String, String>,
9-
message: String? = null,
10+
private val body: String,
11+
private val error: OrbError,
12+
message: String = "$statusCode: $error",
1013
cause: Throwable? = null
1114
) : OrbException(message, cause) {
12-
abstract fun statusCode(): Int
15+
16+
fun statusCode(): Int = statusCode
1317

1418
fun headers(): ListMultimap<String, String> = headers
19+
20+
fun body(): String = body
21+
22+
fun error(): OrbError = error
1523
}

0 commit comments

Comments
 (0)