Skip to content

Commit 0aaf591

Browse files
authored
Merge pull request #67 from apideck-libraries/speakeasy-sdk-regen-1760429797
chore: 🐝 Update SDK - Generate 0.23.0
2 parents f0af50f + 1b9340c commit 0aaf591

File tree

1,099 files changed

+28048
-68638
lines changed

Some content is hidden

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

1,099 files changed

+28048
-68638
lines changed

.speakeasy/gen.lock

Lines changed: 76 additions & 48 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ generation:
1717
oAuth2ClientCredentialsEnabled: true
1818
oAuth2PasswordEnabled: true
1919
hoistGlobalSecurity: true
20+
schemas:
21+
allOfMergeStrategy: shallowMerge
2022
tests:
2123
generateTests: true
2224
generateNewTests: false
2325
skipResponseBodyAssertions: false
2426
java:
25-
version: 0.22.1
27+
version: 0.23.0
2628
additionalDependencies: []
2729
additionalPlugins: []
2830
artifactID: unify

.speakeasy/workflow.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.636.3
1+
speakeasyVersion: 1.638.0
22
sources:
33
Apideck-OAS:
44
sourceNamespace: apideck-oas
5-
sourceRevisionDigest: sha256:284c332c5f33230229bc34bc3a70fb5e205f40df0d163f7911e41d874e0cb1c8
6-
sourceBlobDigest: sha256:cc1a0fc165bc74203fb1b352268314fd298f2abbd75dd8a29d132371b842d45e
5+
sourceRevisionDigest: sha256:d38f634aafc8bd67fab6d8580a3df253866a63416570d238f73e9f72ce0577ad
6+
sourceBlobDigest: sha256:4176a0d252e96d7734ac1c58d1f2a519ddc86675491690f88723e29950634315
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1759403533
10-
- 10.21.4
9+
- speakeasy-sdk-regen-1760429797
10+
- 10.21.6
1111
targets:
1212
apideck:
1313
source: Apideck-OAS
1414
sourceNamespace: apideck-oas
15-
sourceRevisionDigest: sha256:284c332c5f33230229bc34bc3a70fb5e205f40df0d163f7911e41d874e0cb1c8
16-
sourceBlobDigest: sha256:cc1a0fc165bc74203fb1b352268314fd298f2abbd75dd8a29d132371b842d45e
15+
sourceRevisionDigest: sha256:d38f634aafc8bd67fab6d8580a3df253866a63416570d238f73e9f72ce0577ad
16+
sourceBlobDigest: sha256:4176a0d252e96d7734ac1c58d1f2a519ddc86675491690f88723e29950634315
1717
codeSamplesNamespace: apideck-oas-java-code-samples
18-
codeSamplesRevisionDigest: sha256:0168603b15fce4b090b5bc00dc1720e5e370eb2aa42c02698b31375884bf4239
18+
codeSamplesRevisionDigest: sha256:cf427e180a9194a787456a342eaa996f73ee7914a030a98c2f9197434b37d0d1
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

README.md

Lines changed: 174 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ For more information about the API: [Apideck Developer Docs](https://developers.
3131
* [Server Selection](#server-selection)
3232
* [Asynchronous Support](#asynchronous-support)
3333
* [Authentication](#authentication)
34+
* [Custom HTTP Client](#custom-http-client)
3435
* [Debugging](#debugging)
3536
* [Development](#development)
3637
* [Maturity](#maturity)
@@ -49,15 +50,15 @@ The samples below show how a published SDK artifact is used:
4950

5051
Gradle:
5152
```groovy
52-
implementation 'com.apideck:unify:0.22.1'
53+
implementation 'com.apideck:unify:0.23.0'
5354
```
5455

5556
Maven:
5657
```xml
5758
<dependency>
5859
<groupId>com.apideck</groupId>
5960
<artifactId>unify</artifactId>
60-
<version>0.22.1</version>
61+
<version>0.23.0</version>
6162
</dependency>
6263
```
6364

@@ -1003,19 +1004,19 @@ public class Application {
10031004

10041005
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
10051006

1006-
By default, an API error will throw a `models/errors/APIException` exception. When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list` method throws the following exceptions:
10071007

1008-
| Error Type | Status Code | Content Type |
1009-
| ------------------------------------- | ----------- | ---------------- |
1010-
| models/errors/BadRequestResponse | 400 | application/json |
1011-
| models/errors/UnauthorizedResponse | 401 | application/json |
1012-
| models/errors/PaymentRequiredResponse | 402 | application/json |
1013-
| models/errors/NotFoundResponse | 404 | application/json |
1014-
| models/errors/UnprocessableResponse | 422 | application/json |
1015-
| models/errors/APIException | 4XX, 5XX | \*/\* |
1008+
[`ApideckError`](./src/main/java/models/errors/ApideckError.java) is the base class for all HTTP error responses. It has the following properties:
10161009

1017-
### Example
1010+
| Method | Type | Description |
1011+
| ---------------- | --------------------------- | ------------------------------------------------------------------------ |
1012+
| `message()` | `String` | Error message |
1013+
| `code()` | `int` | HTTP response status code eg `404` |
1014+
| `headers` | `Map<String, List<String>>` | HTTP response headers |
1015+
| `body()` | `byte[]` | HTTP body as a byte array. Can be empty array if no body is returned. |
1016+
| `bodyAsString()` | `String` | HTTP body as a UTF-8 string. Can be empty string if no body is returned. |
1017+
| `rawResponse()` | `HttpResponse<?>` | Raw HTTP response (body already read and not available for re-read) |
10181018

1019+
### Example
10191020
```java
10201021
package hello.world;
10211022

@@ -1061,6 +1062,31 @@ public class Application {
10611062
}
10621063
}
10631064
```
1065+
1066+
### Error Classes
1067+
**Primary errors:**
1068+
* [`ApideckError`](./src/main/java/models/errors/ApideckError.java): The base class for HTTP error responses.
1069+
* [`com.apideck.unify.models.errors.UnauthorizedResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.UnauthorizedResponse.java): Unauthorized. Status code `401`.
1070+
* [`com.apideck.unify.models.errors.PaymentRequiredResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.PaymentRequiredResponse.java): Payment Required. Status code `402`.
1071+
* [`com.apideck.unify.models.errors.NotFoundResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.NotFoundResponse.java): The specified resource was not found. Status code `404`. *
1072+
* [`com.apideck.unify.models.errors.BadRequestResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.BadRequestResponse.java): Bad Request. Status code `400`. *
1073+
* [`com.apideck.unify.models.errors.UnprocessableResponse`](./src/main/java/models/errors/com.apideck.unify.models.errors.UnprocessableResponse.java): Unprocessable. Status code `422`. *
1074+
1075+
<details><summary>Less common errors (6)</summary>
1076+
1077+
<br />
1078+
1079+
**Network errors:**
1080+
* `java.io.IOException` (always wrapped by `java.io.UncheckedIOException`). Commonly encountered subclasses of
1081+
`IOException` include `java.net.ConnectException`, `java.net.SocketTimeoutException`, `EOFException` (there are
1082+
many more subclasses in the JDK platform).
1083+
1084+
**Inherit from [`ApideckError`](./src/main/java/models/errors/ApideckError.java)**:
1085+
1086+
1087+
</details>
1088+
1089+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
10641090
<!-- End Error Handling [errors] -->
10651091

10661092
<!-- Start Server Selection [server] -->
@@ -1283,6 +1309,142 @@ public class Application {
12831309
```
12841310
<!-- End Authentication [security] -->
12851311

1312+
<!-- Start Custom HTTP Client [http-client] -->
1313+
## Custom HTTP Client
1314+
1315+
The Java SDK makes API calls using an `HTTPClient` that wraps the native
1316+
[HttpClient](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html). This
1317+
client provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle
1318+
errors and response.
1319+
1320+
The `HTTPClient` interface allows you to either use the default `SpeakeasyHTTPClient` that comes with the SDK,
1321+
or provide your own custom implementation with customized configuration such as custom executors, SSL context,
1322+
connection pools, and other HTTP client settings.
1323+
1324+
The interface provides synchronous (`send`) methods and asynchronous (`sendAsync`) methods. The `sendAsync` method
1325+
is used to power the async SDK methods and returns a `CompletableFuture<HttpResponse<Blob>>` for non-blocking operations.
1326+
1327+
The following example shows how to add a custom header and handle errors:
1328+
1329+
```java
1330+
import com.apideck.unify.Apideck;
1331+
import com.apideck.unify.utils.HTTPClient;
1332+
import com.apideck.unify.utils.SpeakeasyHTTPClient;
1333+
import com.apideck.unify.utils.Utils;
1334+
1335+
import java.io.IOException;
1336+
import java.net.URISyntaxException;
1337+
import java.net.http.HttpRequest;
1338+
import java.net.http.HttpResponse;
1339+
import java.io.InputStream;
1340+
import java.time.Duration;
1341+
1342+
public class Application {
1343+
public static void main(String[] args) {
1344+
// Create a custom HTTP client with hooks
1345+
HTTPClient httpClient = new HTTPClient() {
1346+
private final HTTPClient defaultClient = new SpeakeasyHTTPClient();
1347+
1348+
@Override
1349+
public HttpResponse<InputStream> send(HttpRequest request) throws IOException, URISyntaxException, InterruptedException {
1350+
// Add custom header and timeout using Utils.copy()
1351+
HttpRequest modifiedRequest = Utils.copy(request)
1352+
.header("x-custom-header", "custom value")
1353+
.timeout(Duration.ofSeconds(30))
1354+
.build();
1355+
1356+
try {
1357+
HttpResponse<InputStream> response = defaultClient.send(modifiedRequest);
1358+
// Log successful response
1359+
System.out.println("Request successful: " + response.statusCode());
1360+
return response;
1361+
} catch (Exception error) {
1362+
// Log error
1363+
System.err.println("Request failed: " + error.getMessage());
1364+
throw error;
1365+
}
1366+
}
1367+
};
1368+
1369+
Apideck sdk = Apideck.builder()
1370+
.client(httpClient)
1371+
.build();
1372+
}
1373+
}
1374+
```
1375+
1376+
<details>
1377+
<summary>Custom HTTP Client Configuration</summary>
1378+
1379+
You can also provide a completely custom HTTP client with your own configuration:
1380+
1381+
```java
1382+
import com.apideck.unify.Apideck;
1383+
import com.apideck.unify.utils.HTTPClient;
1384+
import com.apideck.unify.utils.Blob;
1385+
import com.apideck.unify.utils.ResponseWithBody;
1386+
1387+
import java.io.IOException;
1388+
import java.net.URISyntaxException;
1389+
import java.net.http.HttpClient;
1390+
import java.net.http.HttpRequest;
1391+
import java.net.http.HttpResponse;
1392+
import java.io.InputStream;
1393+
import java.time.Duration;
1394+
import java.util.concurrent.Executors;
1395+
import java.util.concurrent.CompletableFuture;
1396+
1397+
public class Application {
1398+
public static void main(String[] args) {
1399+
// Custom HTTP client with custom configuration
1400+
HTTPClient customHttpClient = new HTTPClient() {
1401+
private final HttpClient client = HttpClient.newBuilder()
1402+
.executor(Executors.newFixedThreadPool(10))
1403+
.connectTimeout(Duration.ofSeconds(30))
1404+
// .sslContext(customSslContext) // Add custom SSL context if needed
1405+
.build();
1406+
1407+
@Override
1408+
public HttpResponse<InputStream> send(HttpRequest request) throws IOException, URISyntaxException, InterruptedException {
1409+
return client.send(request, HttpResponse.BodyHandlers.ofInputStream());
1410+
}
1411+
1412+
@Override
1413+
public CompletableFuture<HttpResponse<Blob>> sendAsync(HttpRequest request) {
1414+
// Convert response to HttpResponse<Blob> for async operations
1415+
return client.sendAsync(request, HttpResponse.BodyHandlers.ofPublisher())
1416+
.thenApply(resp -> new ResponseWithBody<>(resp, Blob::from));
1417+
}
1418+
};
1419+
1420+
Apideck sdk = Apideck.builder()
1421+
.client(customHttpClient)
1422+
.build();
1423+
}
1424+
}
1425+
```
1426+
1427+
</details>
1428+
1429+
You can also enable debug logging on the default `SpeakeasyHTTPClient`:
1430+
1431+
```java
1432+
import com.apideck.unify.Apideck;
1433+
import com.apideck.unify.utils.SpeakeasyHTTPClient;
1434+
1435+
public class Application {
1436+
public static void main(String[] args) {
1437+
SpeakeasyHTTPClient httpClient = new SpeakeasyHTTPClient();
1438+
httpClient.enableDebugLogging(true);
1439+
1440+
Apideck sdk = Apideck.builder()
1441+
.client(httpClient)
1442+
.build();
1443+
}
1444+
}
1445+
```
1446+
<!-- End Custom HTTP Client [http-client] -->
1447+
12861448
<!-- Start Debugging [debug] -->
12871449
## Debugging
12881450

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,4 +498,14 @@ Based on:
498498
### Generated
499499
- [java v0.22.1] .
500500
### Releases
501-
- [Maven Central v0.22.1] https://central.sonatype.com/artifact/com.apideck/unify/0.22.1 - .
501+
- [Maven Central v0.22.1] https://central.sonatype.com/artifact/com.apideck/unify/0.22.1 - .
502+
503+
## 2025-10-22 00:12:54
504+
### Changes
505+
Based on:
506+
- OpenAPI Doc
507+
- Speakeasy CLI 1.638.0 (2.728.0) https://github.com/speakeasy-api/speakeasy
508+
### Generated
509+
- [java v0.23.0] .
510+
### Releases
511+
- [Maven Central v0.23.0] https://central.sonatype.com/artifact/com.apideck/unify/0.23.0 - .

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ dependencies {
8181
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2'
8282
api('org.openapitools:jackson-databind-nullable:0.2.6') {exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'}
8383
implementation 'commons-io:commons-io:2.18.0'
84+
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
8485
implementation 'com.jayway.jsonpath:json-path:2.9.0'
8586
api 'org.reactivestreams:reactive-streams:1.0.4'
8687
}

0 commit comments

Comments
 (0)