Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**/.speakeasy/temp/
**/.speakeasy/logs/
.env
.env.local
.speakeasy/reports
# Ignore IDE-specific configs
.project
Expand Down
754 changes: 613 additions & 141 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.533.0
speakeasyVersion: 1.636.3
sources:
my-source:
sourceNamespace: my-source
Expand All @@ -9,11 +9,11 @@ sources:
- main
sample-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:5c4ac3b133a9b0d18d00a131ead78279d8d36a49e31f5f562d1a200fa11caec3
sourceBlobDigest: sha256:7866415b04810057478603476c27c4042cd2561a5f539d7181e4d5eac8ffca0a
sourceRevisionDigest: sha256:59e327c0737e7d230fe332ba797a171c1182b070b8fc74b0c8c0ea0d983ee675
sourceBlobDigest: sha256:5cf719b972274960feef188322a27cea9e780a7ab41144d694f89d150472cf2a
tags:
- latest
- speakeasy-sdk-regen-1733962674
- speakeasy-sdk-regen-1758759470
- 1.0.0
targets:
airbyte-api:
Expand All @@ -24,10 +24,10 @@ targets:
testing:
source: sample-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:5c4ac3b133a9b0d18d00a131ead78279d8d36a49e31f5f562d1a200fa11caec3
sourceBlobDigest: sha256:7866415b04810057478603476c27c4042cd2561a5f539d7181e4d5eac8ffca0a
sourceRevisionDigest: sha256:59e327c0737e7d230fe332ba797a171c1182b070b8fc74b0c8c0ea0d983ee675
sourceBlobDigest: sha256:5cf719b972274960feef188322a27cea9e780a7ab41144d694f89d150472cf2a
codeSamplesNamespace: my-source-java-code-samples
codeSamplesRevisionDigest: sha256:b4a63e27822e0b961739d46a6b15049756d339c93f1008fae50a8052afce6cd9
codeSamplesRevisionDigest: sha256:21370bdb8d7c9be76a1be6e292dce05e6716761867e6d3d6fd270126d2a06592
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
178 changes: 152 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ airbyte-api: Programmatically control Airbyte Cloud, OSS & Enterprise.
* [public-api](#public-api)
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Asynchronous Support](#asynchronous-support)
* [Authentication](#authentication)
* [Available Resources and Operations](#available-resources-and-operations)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Debugging](#debugging)
* [Development](#development)
* [Maturity](#maturity)
* [Contributions](#contributions)
Expand All @@ -42,15 +44,15 @@ The samples below show how a published SDK artifact is used:

Gradle:
```groovy
implementation 'com.airbyte:api:2.0.0'
implementation 'com.airbyte:api:3.0.0'
```

Maven:
```xml
<dependency>
<groupId>com.airbyte</groupId>
<artifactId>api</artifactId>
<version>2.0.0</version>
<version>3.0.0</version>
</dependency>
```

Expand All @@ -67,29 +69,6 @@ On Windows:
```bash
gradlew.bat publishToMavenLocal -Pskip.signing
```

### Logging
A logging framework/facade has not yet been adopted but is under consideration.

For request and response logging (especially json bodies) use:
```java
SpeakeasyHTTPClient.setDebugLogging(true); // experimental API only (may change without warning)
```
Example output:
```
Sending request: http://localhost:35123/bearer#global GET
Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]}
Received response: (GET http://localhost:35123/bearer#global) 200
Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]}
Response body:
{
"authenticated": true,
"token": "global"
}
```
WARNING: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.

Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
<!-- End SDK Installation [installation] -->

<!-- Start SDK Example Usage [usage] -->
Expand Down Expand Up @@ -122,6 +101,7 @@ public class Application {
.destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
.sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
.name("Postgres-to-Bigquery")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();

CreateConnectionResponse res = sdk.connections().createConnection()
Expand All @@ -134,8 +114,120 @@ public class Application {
}
}
```
#### Asynchronous Call
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.
```java
package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.AsyncAirbyte;
import com.airbyte.api.models.operations.async.CreateConnectionResponse;
import com.airbyte.api.models.shared.*;
import java.util.concurrent.CompletableFuture;

public class Application {

public static void main(String[] args) {

AsyncAirbyte sdk = Airbyte.builder()
.security(Security.builder()
.basicAuth(SchemeBasicAuth.builder()
.password("")
.username("")
.build())
.build())
.build()
.async();

ConnectionCreateRequest req = ConnectionCreateRequest.builder()
.destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
.sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
.name("Postgres-to-Bigquery")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();

CompletableFuture<CreateConnectionResponse> resFut = sdk.connections().createConnection()
.request(req)
.call();

resFut.thenAccept(res -> {
if (res.connectionResponse().isPresent()) {
// handle response
}
});
}
}
```

[comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html
<!-- End SDK Example Usage [usage] -->

<!-- Start Asynchronous Support [async-support] -->
## Asynchronous Support

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.

<details>
<summary>Why Use Async?</summary>

Asynchronous operations provide several key benefits:

- **Non-blocking I/O**: Your threads stay free for other work while operations are in flight
- **Better resource utilization**: Handle more concurrent operations with fewer threads
- **Improved scalability**: Build highly responsive applications that can handle thousands of concurrent requests
- **Reactive integration**: Works seamlessly with reactive streams and backpressure handling

</details>

<details>
<summary>Reactive Library Integration</summary>

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.

**Why Reactive Streams over JDK Flow?**
- **Broader ecosystem compatibility**: Most reactive libraries (Project Reactor, RxJava, Akka Streams, etc.) natively support Reactive Streams
- **Industry standard**: Reactive Streams is the de facto standard for reactive programming in Java
- **Better interoperability**: Seamless integration without additional adapters for most use cases

**Integration with Popular Libraries:**
- **Project Reactor**: Use `Flux.from(publisher)` to convert to Reactor types
- **RxJava**: Use `Flowable.fromPublisher(publisher)` for RxJava integration
- **Akka Streams**: Use `Source.fromPublisher(publisher)` for Akka Streams integration
- **Vert.x**: Use `ReadStream.fromPublisher(vertx, publisher)` for Vert.x reactive streams
- **Mutiny**: Use `Multi.createFrom().publisher(publisher)` for Quarkus Mutiny integration

**For JDK Flow API Integration:**
If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use adapters:
```java
// Convert Reactive Streams Publisher to Flow Publisher
Flow.Publisher<T> flowPublisher = FlowAdapters.toFlowPublisher(reactiveStreamsPublisher);

// Convert Flow Publisher to Reactive Streams Publisher
Publisher<T> reactiveStreamsPublisher = FlowAdapters.toPublisher(flowPublisher);
```

For standard single-response operations, the SDK returns `CompletableFuture<T>` for straightforward async execution.

</details>

<details>
<summary>Supported Operations</summary>

Async support is available for:

- **[Server-sent Events](#server-sent-event-streaming)**: Stream real-time events with Reactive Streams `Publisher<T>`
- **[JSONL Streaming](#jsonl-streaming)**: Process streaming JSON lines asynchronously
- **[Pagination](#pagination)**: Iterate through paginated results using `callAsPublisher()` and `callAsPublisherUnwrapped()`
- **[File Uploads](#file-uploads)**: Upload files asynchronously with progress tracking
- **[File Downloads](#file-downloads)**: Download files asynchronously with streaming support
- **[Standard Operations](#example)**: All regular API calls return `CompletableFuture<T>` for async execution

</details>

[comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html
[reactive-streams]: https://www.reactive-streams.org/
<!-- End Asynchronous Support [async-support] -->

<!-- Start Authentication [security] -->
## Authentication

Expand Down Expand Up @@ -175,6 +267,7 @@ public class Application {
.destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
.sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
.name("Postgres-to-Bigquery")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();

CreateConnectionResponse res = sdk.connections().createConnection()
Expand All @@ -195,7 +288,6 @@ public class Application {
<details open>
<summary>Available methods</summary>


### [connections()](docs/sdks/connections/README.md)

* [createConnection](docs/sdks/connections/README.md#createconnection) - Create a connection
Expand Down Expand Up @@ -242,6 +334,7 @@ public class Application {

### [organizations()](docs/sdks/organizations/README.md)

* [createOrUpdateOrganizationOAuthCredentials](docs/sdks/organizations/README.md#createorupdateorganizationoauthcredentials) - Create OAuth override credentials for an organization and source type.
* [listOrganizationsForUser](docs/sdks/organizations/README.md#listorganizationsforuser) - List all organizations for a user

### [permissions()](docs/sdks/permissions/README.md)
Expand Down Expand Up @@ -336,6 +429,7 @@ public class Application {
.destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
.sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
.name("Postgres-to-Bigquery")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();

CreateConnectionResponse res = sdk.connections().createConnection()
Expand Down Expand Up @@ -382,6 +476,7 @@ public class Application {
.destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
.sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
.name("Postgres-to-Bigquery")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();

CreateConnectionResponse res = sdk.connections().createConnection()
Expand All @@ -396,6 +491,37 @@ public class Application {
```
<!-- End Server Selection [server] -->

<!-- Start Debugging [debug] -->
## Debugging

### Debug
You can setup your SDK to emit debug logs for SDK requests and responses.

For request and response logging (especially json bodies), call `enableHTTPDebugLogging(boolean)` on the SDK builder like so:
```java
SDK.builder()
.enableHTTPDebugLogging(true)
.build();
```
Example output:
```
Sending request: http://localhost:35123/bearer#global GET
Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]}
Received response: (GET http://localhost:35123/bearer#global) 200
Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]}
Response body:
{
"authenticated": true,
"token": "global"
}
```
__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.

__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting.

Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
<!-- End Debugging [debug] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# Development
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1201,4 +1201,14 @@ Based on:
### Generated
- [java v2.0.0] .
### Releases
- [Maven Central v2.0.0] https://central.sonatype.com/artifact/com.airbyte/api/2.0.0 - .
- [Maven Central v2.0.0] https://central.sonatype.com/artifact/com.airbyte/api/2.0.0 - .

## 2025-10-10 00:18:05
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.636.3 (2.723.11) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v3.0.0] .
### Releases
- [Maven Central v3.0.0] https://central.sonatype.com/artifact/com.airbyte/api/3.0.0 - .
1 change: 1 addition & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class Application {
.destinationId("e478de0d-a3a0-475c-b019-25f7dd29e281")
.sourceId("95e66a59-8045-4307-9678-63bc3c9b8c93")
.name("Postgres-to-Bigquery")
.namespaceFormat("${SOURCE_NAMESPACE}")
.build();

CreateConnectionResponse res = sdk.connections().createConnection()
Expand Down
Loading