Skip to content

Commit fdd661a

Browse files
Merge pull request #32 from gleanwork/speakeasy-sdk-regen-1758751980
chore: 🐝 Update SDK - Generate 0.9.0
2 parents 41e2d96 + e857deb commit fdd661a

File tree

927 files changed

+62152
-11389
lines changed

Some content is hidden

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

927 files changed

+62152
-11389
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.env
2+
.env.local
13
**/.speakeasy/temp/
24
**/.speakeasy/logs/
35
# Ignore Gradle project-specific cache directory

.speakeasy/gen.lock

Lines changed: 361 additions & 58 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,28 @@ generation:
1616
auth:
1717
oAuth2ClientCredentialsEnabled: true
1818
oAuth2PasswordEnabled: true
19+
hoistGlobalSecurity: true
1920
tests:
2021
generateTests: true
2122
generateNewTests: false
2223
skipResponseBodyAssertions: false
2324
java:
24-
version: 0.8.0
25+
version: 0.9.0
2526
additionalDependencies: []
2627
additionalPlugins: []
2728
artifactID: glean-api-client
29+
asyncMode: enabled
2830
baseErrorName: GleanError
2931
clientServerStatusCodesAsErrors: true
3032
companyEmail: [email protected]
3133
companyName: Glean
3234
companyURL: https://www.glean.com
3335
defaultErrorName: APIException
34-
enableAsync: false
3536
enableCustomCodeRegions: false
37+
enableStreamingUploads: false
3638
envVarPrefix: GLEAN
3739
flattenGlobalSecurity: true
40+
generateSpringBootStarter: true
3841
githubURL: github.com/gleanwork/api-client-java
3942
groupID: com.glean.api-client
4043
imports:

.speakeasy/glean-merged-spec.yaml

Lines changed: 190 additions & 12 deletions
Large diffs are not rendered by default.

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
speakeasyVersion: 1.603.0
1+
speakeasyVersion: 1.625.0
22
sources:
33
Glean API:
44
sourceNamespace: glean-api-specs
5-
sourceRevisionDigest: sha256:8f18d79a0a7d8f51de7edd5bc8ca3ccc569b81832ffc44ce95a27a12e67b9b7d
6-
sourceBlobDigest: sha256:bb3e5a453f03cbdecf3fb3925768ef4cb0b3119083d9d36c341e1ecd721cde8b
5+
sourceRevisionDigest: sha256:a9b49b3146d88faffb25761f988ab0445ed0366b84774a13d4754cb0eb7a3b9b
6+
sourceBlobDigest: sha256:4408853be9bce04865c08fd37b8c11320ffd3b79ef0c70ca8fa1791df0679b1f
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1752597383
9+
- speakeasy-sdk-regen-1758751980
1010
Glean-OAS:
1111
sourceNamespace: glean-oas
1212
sourceRevisionDigest: sha256:8841834dd58ddd4e2dcf98fc90fbd06fbf3626a29df941503cce55b9548a5317
@@ -18,10 +18,10 @@ targets:
1818
glean:
1919
source: Glean API
2020
sourceNamespace: glean-api-specs
21-
sourceRevisionDigest: sha256:8f18d79a0a7d8f51de7edd5bc8ca3ccc569b81832ffc44ce95a27a12e67b9b7d
22-
sourceBlobDigest: sha256:bb3e5a453f03cbdecf3fb3925768ef4cb0b3119083d9d36c341e1ecd721cde8b
21+
sourceRevisionDigest: sha256:a9b49b3146d88faffb25761f988ab0445ed0366b84774a13d4754cb0eb7a3b9b
22+
sourceBlobDigest: sha256:4408853be9bce04865c08fd37b8c11320ffd3b79ef0c70ca8fa1791df0679b1f
2323
codeSamplesNamespace: glean-api-specs-java-code-samples
24-
codeSamplesRevisionDigest: sha256:e2f179bd27ebe8ef2e5db4899dbce44b41be5a1a46f7d62f7df45af109b6df27
24+
codeSamplesRevisionDigest: sha256:c3c55caaa1b1a73bebecf700f844ac1297cd8b9cfe05af2e96def4b62243b444
2525
workflow:
2626
workflowVersion: 1.0.0
2727
speakeasyVersion: latest

README.md

Lines changed: 128 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Remember that each namespace requires its own authentication token type as descr
4141
* [Unified SDK Architecture](#unified-sdk-architecture)
4242
* [SDK Installation](#sdk-installation)
4343
* [SDK Example Usage](#sdk-example-usage)
44+
* [Asynchronous Support](#asynchronous-support)
4445
* [Authentication](#authentication)
4546
* [Available Resources and Operations](#available-resources-and-operations)
4647
* [Error Handling](#error-handling)
@@ -63,15 +64,15 @@ The samples below show how a published SDK artifact is used:
6364

6465
Gradle:
6566
```groovy
66-
implementation 'com.glean.api-client:glean-api-client:0.8.0'
67+
implementation 'com.glean.api-client:glean-api-client:0.9.0'
6768
```
6869

6970
Maven:
7071
```xml
7172
<dependency>
7273
<groupId>com.glean.api-client</groupId>
7374
<artifactId>glean-api-client</artifactId>
74-
<version>0.8.0</version>
75+
<version>0.9.0</version>
7576
</dependency>
7677
```
7778

@@ -116,7 +117,6 @@ public class Application {
116117
.chatRequest(ChatRequest.builder()
117118
.messages(List.of(
118119
ChatMessage.builder()
119-
.author(Author.USER)
120120
.fragments(List.of(
121121
ChatMessageFragment.builder()
122122
.text("What are the company holidays this year?")
@@ -155,7 +155,6 @@ public class Application {
155155
.chatRequest(ChatRequest.builder()
156156
.messages(List.of(
157157
ChatMessage.builder()
158-
.author(Author.USER)
159158
.fragments(List.of(
160159
ChatMessageFragment.builder()
161160
.text("What are the company holidays this year?")
@@ -170,8 +169,132 @@ public class Application {
170169
}
171170
}
172171
```
172+
#### Asynchronous Call
173+
An asynchronous SDK client is also available that returns a [`CompletableFuture<T>`][comp-fut]. See [Asynchronous Support](#asynchronous-support) for more details on async benefits and reactive library integration.
174+
```java
175+
package hello.world;
176+
177+
import com.glean.api_client.glean_api_client.AsyncGlean;
178+
import com.glean.api_client.glean_api_client.Glean;
179+
import com.glean.api_client.glean_api_client.models.components.*;
180+
import com.glean.api_client.glean_api_client.models.operations.async.ActivityResponse;
181+
import java.time.OffsetDateTime;
182+
import java.util.List;
183+
import java.util.concurrent.CompletableFuture;
184+
185+
public class Application {
186+
187+
public static void main(String[] args) {
188+
189+
AsyncGlean sdk = Glean.builder()
190+
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
191+
.build()
192+
.async();
193+
194+
Activity req = Activity.builder()
195+
.events(List.of(
196+
ActivityEvent.builder()
197+
.action(ActivityEventAction.HISTORICAL_VIEW)
198+
.timestamp(OffsetDateTime.parse("2000-01-23T04:56:07.000Z"))
199+
.url("https://example.com/")
200+
.build(),
201+
ActivityEvent.builder()
202+
.action(ActivityEventAction.SEARCH)
203+
.timestamp(OffsetDateTime.parse("2000-01-23T04:56:07.000Z"))
204+
.url("https://example.com/search?q=query")
205+
.params(ActivityEventParams.builder()
206+
.query("query")
207+
.build())
208+
.build(),
209+
ActivityEvent.builder()
210+
.action(ActivityEventAction.VIEW)
211+
.timestamp(OffsetDateTime.parse("2000-01-23T04:56:07.000Z"))
212+
.url("https://example.com/")
213+
.params(ActivityEventParams.builder()
214+
.duration(20L)
215+
.referrer("https://example.com/document")
216+
.build())
217+
.build()))
218+
.build();
219+
220+
CompletableFuture<ActivityResponse> resFut = sdk.client().activity().report()
221+
.request(req)
222+
.call();
223+
224+
// handle response
225+
}
226+
}
227+
```
228+
229+
[comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html
173230
<!-- End SDK Example Usage [usage] -->
174231

232+
<!-- Start Asynchronous Support [async-support] -->
233+
## Asynchronous Support
234+
235+
The SDK provides comprehensive asynchronous support using Java's [`CompletableFuture<T>`][comp-fut] and [Reactive Streams `Publisher<T>`][reactive-streams] APIs. This design makes no assumptions about your choice of reactive toolkit, allowing seamless integration with any reactive library.
236+
237+
<details>
238+
<summary>Why Use Async?</summary>
239+
240+
Asynchronous operations provide several key benefits:
241+
242+
- **Non-blocking I/O**: Your threads stay free for other work while operations are in flight
243+
- **Better resource utilization**: Handle more concurrent operations with fewer threads
244+
- **Improved scalability**: Build highly responsive applications that can handle thousands of concurrent requests
245+
- **Reactive integration**: Works seamlessly with reactive streams and backpressure handling
246+
247+
</details>
248+
249+
<details>
250+
<summary>Reactive Library Integration</summary>
251+
252+
The SDK returns [Reactive Streams `Publisher<T>`][reactive-streams] instances for operations dealing with streams involving multiple I/O interactions. We use Reactive Streams instead of JDK Flow API to provide broader compatibility with the reactive ecosystem, as most reactive libraries natively support Reactive Streams.
253+
254+
**Why Reactive Streams over JDK Flow?**
255+
- **Broader ecosystem compatibility**: Most reactive libraries (Project Reactor, RxJava, Akka Streams, etc.) natively support Reactive Streams
256+
- **Industry standard**: Reactive Streams is the de facto standard for reactive programming in Java
257+
- **Better interoperability**: Seamless integration without additional adapters for most use cases
258+
259+
**Integration with Popular Libraries:**
260+
- **Project Reactor**: Use `Flux.from(publisher)` to convert to Reactor types
261+
- **RxJava**: Use `Flowable.fromPublisher(publisher)` for RxJava integration
262+
- **Akka Streams**: Use `Source.fromPublisher(publisher)` for Akka Streams integration
263+
- **Vert.x**: Use `ReadStream.fromPublisher(vertx, publisher)` for Vert.x reactive streams
264+
- **Mutiny**: Use `Multi.createFrom().publisher(publisher)` for Quarkus Mutiny integration
265+
266+
**For JDK Flow API Integration:**
267+
If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use adapters:
268+
```java
269+
// Convert Reactive Streams Publisher to Flow Publisher
270+
Flow.Publisher<T> flowPublisher = FlowAdapters.toFlowPublisher(reactiveStreamsPublisher);
271+
272+
// Convert Flow Publisher to Reactive Streams Publisher
273+
Publisher<T> reactiveStreamsPublisher = FlowAdapters.toPublisher(flowPublisher);
274+
```
275+
276+
For standard single-response operations, the SDK returns `CompletableFuture<T>` for straightforward async execution.
277+
278+
</details>
279+
280+
<details>
281+
<summary>Supported Operations</summary>
282+
283+
Async support is available for:
284+
285+
- **[Server-sent Events](#server-sent-event-streaming)**: Stream real-time events with Reactive Streams `Publisher<T>`
286+
- **[JSONL Streaming](#jsonl-streaming)**: Process streaming JSON lines asynchronously
287+
- **[Pagination](#pagination)**: Iterate through paginated results using `callAsPublisher()` and `callAsPublisherUnwrapped()`
288+
- **[File Uploads](#file-uploads)**: Upload files asynchronously with progress tracking
289+
- **[File Downloads](#file-downloads)**: Download files asynchronously with streaming support
290+
- **[Standard Operations](#example)**: All regular API calls return `CompletableFuture<T>` for async execution
291+
292+
</details>
293+
294+
[comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html
295+
[reactive-streams]: https://www.reactive-streams.org/
296+
<!-- End Asynchronous Support [async-support] -->
297+
175298
<!-- Start Authentication [security] -->
176299
## Authentication
177300

@@ -1112,7 +1235,7 @@ public class Application {
11121235
.request(req)
11131236
.call();
11141237

1115-
if (res.createCollectionResponse().isPresent()) {
1238+
if (res.oneOf().isPresent()) {
11161239
// handle response
11171240
}
11181241
}

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,14 @@ Based on:
188188
### Generated
189189
- [java v0.8.0] .
190190
### Releases
191-
- [Maven Central v0.8.0] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.8.0 - .
191+
- [Maven Central v0.8.0] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.8.0 - .
192+
193+
## 2025-09-24 22:12:38
194+
### Changes
195+
Based on:
196+
- OpenAPI Doc
197+
- Speakeasy CLI 1.625.0 (2.715.0) https://github.com/speakeasy-api/speakeasy
198+
### Generated
199+
- [java v0.9.0] .
200+
### Releases
201+
- [Maven Central v0.9.0] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.9.0 - .

USAGE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public class Application {
2020
.chatRequest(ChatRequest.builder()
2121
.messages(List.of(
2222
ChatMessage.builder()
23-
.author(Author.USER)
2423
.fragments(List.of(
2524
ChatMessageFragment.builder()
2625
.text("What are the company holidays this year?")
@@ -57,7 +56,6 @@ public class Application {
5756
.chatRequest(ChatRequest.builder()
5857
.messages(List.of(
5958
ChatMessage.builder()
60-
.author(Author.USER)
6159
.fragments(List.of(
6260
ChatMessageFragment.builder()
6361
.text("What are the company holidays this year?")

0 commit comments

Comments
 (0)