Skip to content

Latest commit

 

History

History
488 lines (384 loc) · 22 KB

File metadata and controls

488 lines (384 loc) · 22 KB

Destinations

(destinations())

Available Operations

createDestination

Creates a destination given a name, workspace id, and a json blob containing the configuration for the source.

Example Usage

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
                .build();

            DestinationCreateRequest req = DestinationCreateRequest.builder()
                .configuration(DestinationConfiguration.of(DestinationGoogleSheets.builder()
                            .credentials(AuthenticationViaGoogleOAuth.builder()
                                    .clientId("<value>")
                                    .clientSecret("<value>")
                                    .refreshToken("<value>")
                                    .build())
                            .spreadsheetId("https://docs.google.com/spreadsheets/d/1hLd9Qqti3UyLXZB2aFfUWDT7BG/edit")
                            .build()))
                .name("<value>")
                .workspaceId("8360860a-d46e-48e6-af62-08e5ba5019ef")
                .build();

            CreateDestinationResponse res = sdk.destinations().createDestination()
                .request(req)
                .call();

            if (res.destinationResponse().isPresent()) {
                // handle response
            }
        } catch (com.airbyte.api.models.errors.SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
request com.airbyte.api.models.shared.DestinationCreateRequest ✔️ The request object to use for the request.

Response

com.airbyte.api.models.operations.CreateDestinationResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

deleteDestination

Delete a Destination

Example Usage

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
                .build();

            DeleteDestinationRequest req = DeleteDestinationRequest.builder()
                .destinationId("<value>")
                .build();

            DeleteDestinationResponse res = sdk.destinations().deleteDestination()
                .request(req)
                .call();

            // handle response
        } catch (com.airbyte.api.models.errors.SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
request com.airbyte.api.models.operations.DeleteDestinationRequest ✔️ The request object to use for the request.

Response

com.airbyte.api.models.operations.DeleteDestinationResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

getDestination

Get Destination details

Example Usage

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
                .build();

            GetDestinationRequest req = GetDestinationRequest.builder()
                .destinationId("<value>")
                .build();

            GetDestinationResponse res = sdk.destinations().getDestination()
                .request(req)
                .call();

            if (res.destinationResponse().isPresent()) {
                // handle response
            }
        } catch (com.airbyte.api.models.errors.SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
request com.airbyte.api.models.operations.GetDestinationRequest ✔️ The request object to use for the request.

Response

com.airbyte.api.models.operations.GetDestinationResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

listDestinations

List destinations

Example Usage

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
                .build();

            ListDestinationsRequest req = ListDestinationsRequest.builder()
                .build();

            ListDestinationsResponse res = sdk.destinations().listDestinations()
                .request(req)
                .call();

            if (res.destinationsResponse().isPresent()) {
                // handle response
            }
        } catch (com.airbyte.api.models.errors.SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
request com.airbyte.api.models.operations.ListDestinationsRequest ✔️ The request object to use for the request.

Response

com.airbyte.api.models.operations.ListDestinationsResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

patchDestination

Update a Destination

Example Usage

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
                .build();

            PatchDestinationRequest req = PatchDestinationRequest.builder()
                .destinationId("<value>")
                .destinationPatchRequest(DestinationPatchRequest.builder()
                    .configuration(DestinationConfiguration.of(DestinationGoogleSheets.builder()
                                .credentials(AuthenticationViaGoogleOAuth.builder()
                                        .clientId("<value>")
                                        .clientSecret("<value>")
                                        .refreshToken("<value>")
                                        .build())
                                .spreadsheetId("https://docs.google.com/spreadsheets/d/1hLd9Qqti3UyLXZB2aFfUWDT7BG/edit")
                                .build()))
                    .build())
                .build();

            PatchDestinationResponse res = sdk.destinations().patchDestination()
                .request(req)
                .call();

            if (res.destinationResponse().isPresent()) {
                // handle response
            }
        } catch (com.airbyte.api.models.errors.SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
request com.airbyte.api.models.operations.PatchDestinationRequest ✔️ The request object to use for the request.

Response

com.airbyte.api.models.operations.PatchDestinationResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

putDestination

Update a Destination and fully overwrite it

Example Usage

package hello.world;

import com.airbyte.api.Airbyte;
import com.airbyte.api.models.operations.*;
import com.airbyte.api.models.shared.*;
import com.airbyte.api.models.shared.Security;
import com.airbyte.api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Airbyte sdk = Airbyte.builder()
                .security(Security.builder()
                    .basicAuth(SchemeBasicAuth.builder()
                        .password("")
                        .username("")
                        .build())
                    .build())
                .build();

            PutDestinationRequest req = PutDestinationRequest.builder()
                .destinationId("<value>")
                .destinationPutRequest(DestinationPutRequest.builder()
                    .configuration(DestinationConfiguration.of(DestinationGoogleSheets.builder()
                                .credentials(AuthenticationViaGoogleOAuth.builder()
                                        .clientId("<value>")
                                        .clientSecret("<value>")
                                        .refreshToken("<value>")
                                        .build())
                                .spreadsheetId("https://docs.google.com/spreadsheets/d/1hLd9Qqti3UyLXZB2aFfUWDT7BG/edit")
                                .build()))
                    .name("<value>")
                    .build())
                .build();

            PutDestinationResponse res = sdk.destinations().putDestination()
                .request(req)
                .call();

            if (res.destinationResponse().isPresent()) {
                // handle response
            }
        } catch (com.airbyte.api.models.errors.SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
request com.airbyte.api.models.operations.PutDestinationRequest ✔️ The request object to use for the request.

Response

com.airbyte.api.models.operations.PutDestinationResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*