Skip to content

simplesagar/airbyte-api-java-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Programatically control Airbyte Cloud through an API.

Authentication

Developers will need to create an API Key within your Developer Portal to make API requests. You can use your existing Airbyte account to log in to the Developer Portal. Once you are in the Developer Portal, use the API Keys tab to create or remove API Keys. You can see a walkthrough demo here🎦

The Developer Portal UI can also be used to help build your integration by showing information about network requests in the Requests tab. API usage information is also available to you in the Usage tab.

SDK Installation

Gradle

implementation 'com.airbyte.api:public-api:0.18.2'

SDK Example Usage

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.CreateConnectionResponse;
import com.airbyte.api.models.shared.ConnectionCreateRequest;
import com.airbyte.api.models.shared.ConnectionSchedule;
import com.airbyte.api.models.shared.ConnectionStatusEnum;
import com.airbyte.api.models.shared.ConnectionSyncModeEnum;
import com.airbyte.api.models.shared.GeographyEnum;
import com.airbyte.api.models.shared.NamespaceDefinitionEnum;
import com.airbyte.api.models.shared.NonBreakingSchemaUpdatesBehaviorEnum;
import com.airbyte.api.models.shared.ScheduleTypeEnum;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.models.shared.StreamConfiguration;
import com.airbyte.api.models.shared.StreamConfigurations;

public class Application {
    public static void main(String[] args) {
        try {
            Airbyte sdk = Airbyte.builder()
                .setSecurity(new Security("corrupti") {{
                    bearerAuth = "";
                }})
                .build();

            com.airbyte.api.models.shared.ConnectionCreateRequest req = new ConnectionCreateRequest("9bd9d8d6-9a67-44e0-b467-cc8796ed151a", "05dfc2dd-f7cc-478c-a1ba-928fc816742c") {{
                configurations = new StreamConfigurations() {{
                    streams = new com.airbyte.api.models.shared.StreamConfiguration[]{{
                        add(new StreamConfiguration("saepe") {{
                            cursorField = new String[]{{
                                add("ipsum"),
                                add("excepturi"),
                            }};
                            name = "Dorothy Hane";
                            primaryKey = new String[][]{{
                                add(new String[]{{
                                    add("natus"),
                                }}),
                                add(new String[]{{
                                    add("hic"),
                                    add("saepe"),
                                }}),
                                add(new String[]{{
                                    add("in"),
                                    add("corporis"),
                                    add("iste"),
                                }}),
                            }};
                            syncMode = ConnectionSyncModeEnum.FULL_REFRESH_APPEND;
                        }}),
                        add(new StreamConfiguration("excepturi") {{
                            cursorField = new String[]{{
                                add("architecto"),
                                add("ipsa"),
                                add("reiciendis"),
                            }};
                            name = "Shaun Osinski";
                            primaryKey = new String[][]{{
                                add(new String[]{{
                                    add("nobis"),
                                }}),
                                add(new String[]{{
                                    add("omnis"),
                                    add("nemo"),
                                }}),
                            }};
                            syncMode = ConnectionSyncModeEnum.FULL_REFRESH_APPEND;
                        }}),
                        add(new StreamConfiguration("quia") {{
                            cursorField = new String[]{{
                                add("iure"),
                            }};
                            name = "Miss Aubrey Williamson";
                            primaryKey = new String[][]{{
                                add(new String[]{{
                                    add("repellat"),
                                }}),
                                add(new String[]{{
                                    add("occaecati"),
                                    add("numquam"),
                                    add("commodi"),
                                }}),
                                add(new String[]{{
                                    add("molestiae"),
                                    add("velit"),
                                }}),
                            }};
                            syncMode = ConnectionSyncModeEnum.INCREMENTAL_APPEND;
                        }}),
                    }};
                }};;
                dataResidency = GeographyEnum.US;
                name = "Kayla O'Kon";
                namespaceDefinition = NamespaceDefinitionEnum.CUSTOM_FORMAT;
                namespaceFormat = "${SOURCE_NAMESPACE}";
                nonBreakingSchemaUpdatesBehavior = NonBreakingSchemaUpdatesBehaviorEnum.IGNORE;
                prefix = "tenetur";
                schedule = new ConnectionSchedule(ScheduleTypeEnum.MANUAL) {{
                    cronExpression = "id";
                }};;
                status = ConnectionStatusEnum.DEPRECATED;
            }};            

            CreateConnectionResponse res = sdk.connections.createConnection(req);

            if (res.connectionResponse != null) {
                // handle response
            }
        } catch (Exception e) {
            // handle exception
        }
    }
}

Available Resources and Operations

  • cancelJob - Cancel a running Job
  • createJob - Trigger a sync or reset job of a connection
  • getJob - Get Job status and details
  • listJobs - List Jobs by sync type

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !

SDK Created by Speakeasy

About

Java SDK for Airbyte API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%