Skip to content

Latest commit

 

History

History
executable file
·
34 lines (29 loc) · 1.05 KB

USAGE.md

File metadata and controls

executable file
·
34 lines (29 loc) · 1.05 KB
package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.models.operations.CreateConnectionResponse;
import com.airbyte.api.models.shared.ConnectionCreate;

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

            com.airbyte.api.models.shared.ConnectionCreate req = new ConnectionCreate() {{
                destinationId = "unde";
                name = "deserunt";
                sourceId = "porro";
            }}            

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

            if (res.connectionId.isPresent()) {
                // handle response
            }
        } catch (Exception e) {
            // handle exception
        }