diff --git a/README.md b/README.md index 865c97085..a90464013 100755 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The Developer Portal UI can also be used to help build your integration by showi ### Gradle ```groovy -implementation 'com.airbyte.api:public-api:0.14.2' +implementation 'com.airbyte.api:public-api:0.15.0' ``` diff --git a/RELEASES.md b/RELEASES.md index 22afbc3cd..391f0c103 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -343,4 +343,12 @@ Based on: - OpenAPI Doc 1.0.0 - Speakeasy CLI 1.40.3 (2.34.7) https://github.com/speakeasy-api/speakeasy ### Releases -- [Maven Central v0.14.2] https://central.sonatype.com/artifact/com.airbyte/api/0.14.2 - . \ No newline at end of file +- [Maven Central v0.14.2] https://central.sonatype.com/artifact/com.airbyte/api/0.14.2 - . + +## 2023-06-03 00:12:41 +### Changes +Based on: +- OpenAPI Doc 1.0.0 +- Speakeasy CLI 1.43.0 (2.35.3) https://github.com/speakeasy-api/speakeasy +### Releases +- [Maven Central v0.15.0] https://central.sonatype.com/artifact/com.airbyte/api/0.15.0 - . \ No newline at end of file diff --git a/files.gen b/files.gen index eb01f5f38..598d22e69 100755 --- a/files.gen +++ b/files.gen @@ -1,3 +1,4 @@ +lib/src/main/java/com/airbyte/api/SDKConfiguration.java lib/src/main/java/com/airbyte/api/Connections.java lib/src/main/java/com/airbyte/api/Destinations.java lib/src/main/java/com/airbyte/api/Jobs.java diff --git a/gen.yaml b/gen.yaml index 3a2dfce9e..aa556c59b 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,14 +2,14 @@ configVersion: 1.0.0 management: docChecksum: e82f3e11abf47c2509f115468e75bb06 docVersion: 1.0.0 - speakeasyVersion: 1.40.3 - generationVersion: 2.34.7 + speakeasyVersion: 1.43.0 + generationVersion: 2.35.3 generation: sdkClassName: airbyte singleTagPerOp: false telemetryEnabled: true java: - version: 0.14.2 + version: 0.15.0 artifactID: api companyEmail: info@airbyte.com companyName: Airbyte diff --git a/lib/build.gradle b/lib/build.gradle index b6a9cc1f9..9c2b0ec8f 100755 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -41,7 +41,7 @@ publishing { maven(MavenPublication) { groupId = 'com.airbyte' artifactId = 'api' - version = '0.14.2' + version = '0.15.0' from components.java diff --git a/lib/src/main/java/com/airbyte/api/Airbyte.java b/lib/src/main/java/com/airbyte/api/Airbyte.java index e52196281..cbbbe9296 100755 --- a/lib/src/main/java/com/airbyte/api/Airbyte.java +++ b/lib/src/main/java/com/airbyte/api/Airbyte.java @@ -25,21 +25,13 @@ public class Airbyte { public Streams streams; public Workspaces workspaces; - private HTTPClient _defaultClient; - private HTTPClient _securityClient; - private com.airbyte.api.models.shared.Security _security; - private String _serverUrl; - private String _language = "java"; - private String _sdkVersion = "0.14.2"; - private String _genVersion = "2.34.7"; + private SDKConfiguration sdkConfiguration; + /** * The Builder class allows the configuration of a new instance of the SDK. */ public static class Builder { - private HTTPClient client; - private com.airbyte.api.models.shared.Security security; - private String serverUrl; - private java.util.Map params = new java.util.HashMap(); + private SDKConfiguration sdkConfiguration = new SDKConfiguration(); private Builder() { } @@ -50,7 +42,7 @@ private Builder() { * @return The builder instance. */ public Builder setClient(HTTPClient client) { - this.client = client; + this.sdkConfiguration.defaultClient = client; return this; } @@ -60,7 +52,7 @@ public Builder setClient(HTTPClient client) { * @return The builder instance. */ public Builder setSecurity(com.airbyte.api.models.shared.Security security) { - this.security = security; + this.sdkConfiguration.security = security; return this; } @@ -70,7 +62,7 @@ public Builder setSecurity(com.airbyte.api.models.shared.Security security) { * @return The builder instance. */ public Builder setServerURL(String serverUrl) { - this.serverUrl = serverUrl; + this.sdkConfiguration.serverUrl = serverUrl; return this; } @@ -81,8 +73,18 @@ public Builder setServerURL(String serverUrl) { * @return The builder instance. */ public Builder setServerURL(String serverUrl, java.util.Map params) { - this.serverUrl = serverUrl; - this.params = params; + this.sdkConfiguration.serverUrl = com.airbyte.api.utils.Utils.templateUrl(serverUrl, params); + return this; + } + + /** + * Allows the overriding of the default server by index + * @param serverIdx The server to use for all requests. + * @return The builder instance. + */ + public Builder setServerIndex(int serverIdx) { + this.sdkConfiguration.serverIdx = serverIdx; + this.sdkConfiguration.serverUrl = SERVERS[serverIdx]; return this; } @@ -92,7 +94,28 @@ public Builder setServerURL(String serverUrl, java.util.Map para * @throws Exception Thrown if the SDK could not be built. */ public Airbyte build() throws Exception { - return new Airbyte(this.client, this.security, this.serverUrl, this.params); + if (this.sdkConfiguration.defaultClient == null) { + this.sdkConfiguration.defaultClient = new SpeakeasyHTTPClient(); + } + + if (this.sdkConfiguration.security != null) { + this.sdkConfiguration.securityClient = com.airbyte.api.utils.Utils.configureSecurityClient(this.sdkConfiguration.defaultClient, this.sdkConfiguration.security); + } + + if (this.sdkConfiguration.securityClient == null) { + this.sdkConfiguration.securityClient = this.sdkConfiguration.defaultClient; + } + + if (this.sdkConfiguration.serverUrl == null || this.sdkConfiguration.serverUrl.isBlank()) { + this.sdkConfiguration.serverUrl = SERVERS[0]; + this.sdkConfiguration.serverIdx = 0; + } + + if (this.sdkConfiguration.serverUrl.endsWith("/")) { + this.sdkConfiguration.serverUrl = this.sdkConfiguration.serverUrl.substring(0, this.sdkConfiguration.serverUrl.length() - 1); + } + + return new Airbyte(this.sdkConfiguration); } } @@ -104,88 +127,19 @@ public static Builder builder() { return new Builder(); } - private Airbyte(HTTPClient client, com.airbyte.api.models.shared.Security security, String serverUrl, java.util.Map params) throws Exception { - this._defaultClient = client; - - if (this._defaultClient == null) { - this._defaultClient = new SpeakeasyHTTPClient(); - } - - if (security != null) { - this._security = security; - this._securityClient = com.airbyte.api.utils.Utils.configureSecurityClient(this._defaultClient, this._security); - } - - if (this._securityClient == null) { - this._securityClient = this._defaultClient; - } - - if (serverUrl != null && !serverUrl.isBlank()) { - this._serverUrl = com.airbyte.api.utils.Utils.templateUrl(serverUrl, params); - } - - if (this._serverUrl == null) { - this._serverUrl = SERVERS[0]; - } - - if (this._serverUrl.endsWith("/")) { - this._serverUrl = this._serverUrl.substring(0, this._serverUrl.length() - 1); - } - - + private Airbyte(SDKConfiguration sdkConfiguration) throws Exception { + this.sdkConfiguration = sdkConfiguration; - this.connections = new Connections( - this._defaultClient, - this._securityClient, - this._serverUrl, - this._language, - this._sdkVersion, - this._genVersion - ); + this.connections = new Connections(this.sdkConfiguration); - this.destinations = new Destinations( - this._defaultClient, - this._securityClient, - this._serverUrl, - this._language, - this._sdkVersion, - this._genVersion - ); + this.destinations = new Destinations(this.sdkConfiguration); - this.jobs = new Jobs( - this._defaultClient, - this._securityClient, - this._serverUrl, - this._language, - this._sdkVersion, - this._genVersion - ); + this.jobs = new Jobs(this.sdkConfiguration); - this.sources = new Sources( - this._defaultClient, - this._securityClient, - this._serverUrl, - this._language, - this._sdkVersion, - this._genVersion - ); + this.sources = new Sources(this.sdkConfiguration); - this.streams = new Streams( - this._defaultClient, - this._securityClient, - this._serverUrl, - this._language, - this._sdkVersion, - this._genVersion - ); + this.streams = new Streams(this.sdkConfiguration); - this.workspaces = new Workspaces( - this._defaultClient, - this._securityClient, - this._serverUrl, - this._language, - this._sdkVersion, - this._genVersion - ); + this.workspaces = new Workspaces(this.sdkConfiguration); } } \ No newline at end of file diff --git a/lib/src/main/java/com/airbyte/api/Connections.java b/lib/src/main/java/com/airbyte/api/Connections.java index f8b303d70..53dc4b758 100755 --- a/lib/src/main/java/com/airbyte/api/Connections.java +++ b/lib/src/main/java/com/airbyte/api/Connections.java @@ -15,20 +15,10 @@ public class Connections { - private HTTPClient _defaultClient; - private HTTPClient _securityClient; - private String _serverUrl; - private String _language; - private String _sdkVersion; - private String _genVersion; - - public Connections(HTTPClient defaultClient, HTTPClient securityClient, String serverUrl, String language, String sdkVersion, String genVersion) { - this._defaultClient = defaultClient; - this._securityClient = securityClient; - this._serverUrl = serverUrl; - this._language = language; - this._sdkVersion = sdkVersion; - this._genVersion = genVersion; + private SDKConfiguration sdkConfiguration; + + public Connections(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } /** @@ -38,7 +28,7 @@ public Connections(HTTPClient defaultClient, HTTPClient securityClient, String s * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.CreateConnectionResponse createConnection(com.airbyte.api.models.shared.ConnectionCreateRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/connections"); HTTPRequest req = new HTTPRequest(); @@ -51,9 +41,9 @@ public com.airbyte.api.models.operations.CreateConnectionResponse createConnecti req.setBody(serializedRequestBody); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -84,7 +74,7 @@ else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 403) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.DeleteConnectionResponse deleteConnection(com.airbyte.api.models.operations.DeleteConnectionRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.DeleteConnectionRequest.class, baseUrl, "/connections/{connectionId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -92,9 +82,9 @@ public com.airbyte.api.models.operations.DeleteConnectionResponse deleteConnecti req.setURL(url); req.addHeader("Accept", "*/*"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -117,7 +107,7 @@ public com.airbyte.api.models.operations.DeleteConnectionResponse deleteConnecti * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.GetConnectionResponse getConnection(com.airbyte.api.models.operations.GetConnectionRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.GetConnectionRequest.class, baseUrl, "/connections/{connectionId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -125,9 +115,9 @@ public com.airbyte.api.models.operations.GetConnectionResponse getConnection(com req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -158,7 +148,7 @@ else if (httpRes.statusCode() == 403 || httpRes.statusCode() == 404) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.ListConnectionsResponse listConnections(com.airbyte.api.models.operations.ListConnectionsRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/connections"); HTTPRequest req = new HTTPRequest(); @@ -166,7 +156,7 @@ public com.airbyte.api.models.operations.ListConnectionsResponse listConnections req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); java.util.List queryParams = com.airbyte.api.utils.Utils.getQueryParams(com.airbyte.api.models.operations.ListConnectionsRequest.class, request, null); if (queryParams != null) { for (NameValuePair queryParam : queryParams) { @@ -174,7 +164,7 @@ public com.airbyte.api.models.operations.ListConnectionsResponse listConnections } } - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); diff --git a/lib/src/main/java/com/airbyte/api/Destinations.java b/lib/src/main/java/com/airbyte/api/Destinations.java index fb6ad130f..52b0dce50 100755 --- a/lib/src/main/java/com/airbyte/api/Destinations.java +++ b/lib/src/main/java/com/airbyte/api/Destinations.java @@ -15,20 +15,10 @@ public class Destinations { - private HTTPClient _defaultClient; - private HTTPClient _securityClient; - private String _serverUrl; - private String _language; - private String _sdkVersion; - private String _genVersion; - - public Destinations(HTTPClient defaultClient, HTTPClient securityClient, String serverUrl, String language, String sdkVersion, String genVersion) { - this._defaultClient = defaultClient; - this._securityClient = securityClient; - this._serverUrl = serverUrl; - this._language = language; - this._sdkVersion = sdkVersion; - this._genVersion = genVersion; + private SDKConfiguration sdkConfiguration; + + public Destinations(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } /** @@ -39,7 +29,7 @@ public Destinations(HTTPClient defaultClient, HTTPClient securityClient, String * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.CreateDestinationResponse createDestination(com.airbyte.api.models.shared.DestinationCreateRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/destinations"); HTTPRequest req = new HTTPRequest(); @@ -49,9 +39,9 @@ public com.airbyte.api.models.operations.CreateDestinationResponse createDestina req.setBody(serializedRequestBody); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -82,7 +72,7 @@ else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 403 || httpRes.s * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.DeleteDestinationResponse deleteDestination(com.airbyte.api.models.operations.DeleteDestinationRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.DeleteDestinationRequest.class, baseUrl, "/destinations/{destinationId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -90,9 +80,9 @@ public com.airbyte.api.models.operations.DeleteDestinationResponse deleteDestina req.setURL(url); req.addHeader("Accept", "*/*"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -115,7 +105,7 @@ public com.airbyte.api.models.operations.DeleteDestinationResponse deleteDestina * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.GetDestinationResponse getDestination(com.airbyte.api.models.operations.GetDestinationRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.GetDestinationRequest.class, baseUrl, "/destinations/{destinationId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -123,9 +113,9 @@ public com.airbyte.api.models.operations.GetDestinationResponse getDestination(c req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -156,7 +146,7 @@ else if (httpRes.statusCode() == 403 || httpRes.statusCode() == 404) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.ListDestinationsResponse listDestinations(com.airbyte.api.models.operations.ListDestinationsRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/destinations"); HTTPRequest req = new HTTPRequest(); @@ -164,7 +154,7 @@ public com.airbyte.api.models.operations.ListDestinationsResponse listDestinatio req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); java.util.List queryParams = com.airbyte.api.utils.Utils.getQueryParams(com.airbyte.api.models.operations.ListDestinationsRequest.class, request, null); if (queryParams != null) { for (NameValuePair queryParam : queryParams) { @@ -172,7 +162,7 @@ public com.airbyte.api.models.operations.ListDestinationsResponse listDestinatio } } - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); diff --git a/lib/src/main/java/com/airbyte/api/Jobs.java b/lib/src/main/java/com/airbyte/api/Jobs.java index cdce3a9ec..831424cd8 100755 --- a/lib/src/main/java/com/airbyte/api/Jobs.java +++ b/lib/src/main/java/com/airbyte/api/Jobs.java @@ -15,20 +15,10 @@ public class Jobs { - private HTTPClient _defaultClient; - private HTTPClient _securityClient; - private String _serverUrl; - private String _language; - private String _sdkVersion; - private String _genVersion; - - public Jobs(HTTPClient defaultClient, HTTPClient securityClient, String serverUrl, String language, String sdkVersion, String genVersion) { - this._defaultClient = defaultClient; - this._securityClient = securityClient; - this._serverUrl = serverUrl; - this._language = language; - this._sdkVersion = sdkVersion; - this._genVersion = genVersion; + private SDKConfiguration sdkConfiguration; + + public Jobs(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } /** @@ -38,7 +28,7 @@ public Jobs(HTTPClient defaultClient, HTTPClient securityClient, String serverUr * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.CancelJobResponse cancelJob(com.airbyte.api.models.operations.CancelJobRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.CancelJobRequest.class, baseUrl, "/jobs/{jobId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -46,9 +36,9 @@ public com.airbyte.api.models.operations.CancelJobResponse cancelJob(com.airbyte req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -79,7 +69,7 @@ else if (httpRes.statusCode() == 403 || httpRes.statusCode() == 404) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.CreateJobResponse createJob(com.airbyte.api.models.shared.JobCreateRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/jobs"); HTTPRequest req = new HTTPRequest(); @@ -92,9 +82,9 @@ public com.airbyte.api.models.operations.CreateJobResponse createJob(com.airbyte req.setBody(serializedRequestBody); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -125,7 +115,7 @@ else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 403) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.GetJobResponse getJob(com.airbyte.api.models.operations.GetJobRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.GetJobRequest.class, baseUrl, "/jobs/{jobId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -133,9 +123,9 @@ public com.airbyte.api.models.operations.GetJobResponse getJob(com.airbyte.api.m req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -166,7 +156,7 @@ else if (httpRes.statusCode() == 403 || httpRes.statusCode() == 404) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.ListJobsResponse listJobs(com.airbyte.api.models.operations.ListJobsRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/jobs"); HTTPRequest req = new HTTPRequest(); @@ -174,7 +164,7 @@ public com.airbyte.api.models.operations.ListJobsResponse listJobs(com.airbyte.a req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); java.util.List queryParams = com.airbyte.api.utils.Utils.getQueryParams(com.airbyte.api.models.operations.ListJobsRequest.class, request, null); if (queryParams != null) { for (NameValuePair queryParam : queryParams) { @@ -182,7 +172,7 @@ public com.airbyte.api.models.operations.ListJobsResponse listJobs(com.airbyte.a } } - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); diff --git a/lib/src/main/java/com/airbyte/api/SDKConfiguration.java b/lib/src/main/java/com/airbyte/api/SDKConfiguration.java new file mode 100755 index 000000000..fb341925b --- /dev/null +++ b/lib/src/main/java/com/airbyte/api/SDKConfiguration.java @@ -0,0 +1,20 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package com.airbyte.api; + +import com.airbyte.api.utils.HTTPClient; +import com.airbyte.api.models.shared.Security; + +class SDKConfiguration { + public HTTPClient defaultClient; + public HTTPClient securityClient; + public Security security; + public String serverUrl; + public int serverIdx = 0; + public String language = "java"; + public String sdkVersion = "0.15.0"; + public String genVersion = "2.35.3"; + +} \ No newline at end of file diff --git a/lib/src/main/java/com/airbyte/api/Sources.java b/lib/src/main/java/com/airbyte/api/Sources.java index 6a330d85a..db6fa582b 100755 --- a/lib/src/main/java/com/airbyte/api/Sources.java +++ b/lib/src/main/java/com/airbyte/api/Sources.java @@ -15,20 +15,10 @@ public class Sources { - private HTTPClient _defaultClient; - private HTTPClient _securityClient; - private String _serverUrl; - private String _language; - private String _sdkVersion; - private String _genVersion; - - public Sources(HTTPClient defaultClient, HTTPClient securityClient, String serverUrl, String language, String sdkVersion, String genVersion) { - this._defaultClient = defaultClient; - this._securityClient = securityClient; - this._serverUrl = serverUrl; - this._language = language; - this._sdkVersion = sdkVersion; - this._genVersion = genVersion; + private SDKConfiguration sdkConfiguration; + + public Sources(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } /** @@ -39,7 +29,7 @@ public Sources(HTTPClient defaultClient, HTTPClient securityClient, String serve * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.CreateSourceResponse createSource(com.airbyte.api.models.shared.SourceCreateRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/sources"); HTTPRequest req = new HTTPRequest(); @@ -49,9 +39,9 @@ public com.airbyte.api.models.operations.CreateSourceResponse createSource(com.a req.setBody(serializedRequestBody); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -82,7 +72,7 @@ else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 403) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.DeleteSourceResponse deleteSource(com.airbyte.api.models.operations.DeleteSourceRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.DeleteSourceRequest.class, baseUrl, "/sources/{sourceId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -90,9 +80,9 @@ public com.airbyte.api.models.operations.DeleteSourceResponse deleteSource(com.a req.setURL(url); req.addHeader("Accept", "*/*"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -115,7 +105,7 @@ public com.airbyte.api.models.operations.DeleteSourceResponse deleteSource(com.a * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.GetSourceResponse getSource(com.airbyte.api.models.operations.GetSourceRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.GetSourceRequest.class, baseUrl, "/sources/{sourceId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -123,9 +113,9 @@ public com.airbyte.api.models.operations.GetSourceResponse getSource(com.airbyte req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -161,7 +151,7 @@ else if (httpRes.statusCode() == 403 || httpRes.statusCode() == 404) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.InitiateOAuthResponse initiateOAuth(com.airbyte.api.models.shared.InitiateOauthRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/sources/initiateOAuth"); HTTPRequest req = new HTTPRequest(); @@ -174,9 +164,9 @@ public com.airbyte.api.models.operations.InitiateOAuthResponse initiateOAuth(com req.setBody(serializedRequestBody); req.addHeader("Accept", "*/*"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -199,7 +189,7 @@ public com.airbyte.api.models.operations.InitiateOAuthResponse initiateOAuth(com * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.ListSourcesResponse listSources(com.airbyte.api.models.operations.ListSourcesRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/sources"); HTTPRequest req = new HTTPRequest(); @@ -207,7 +197,7 @@ public com.airbyte.api.models.operations.ListSourcesResponse listSources(com.air req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); java.util.List queryParams = com.airbyte.api.utils.Utils.getQueryParams(com.airbyte.api.models.operations.ListSourcesRequest.class, request, null); if (queryParams != null) { for (NameValuePair queryParam : queryParams) { @@ -215,7 +205,7 @@ public com.airbyte.api.models.operations.ListSourcesResponse listSources(com.air } } - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); diff --git a/lib/src/main/java/com/airbyte/api/Streams.java b/lib/src/main/java/com/airbyte/api/Streams.java index de1c1ada4..944a9cbe5 100755 --- a/lib/src/main/java/com/airbyte/api/Streams.java +++ b/lib/src/main/java/com/airbyte/api/Streams.java @@ -14,20 +14,10 @@ public class Streams { - private HTTPClient _defaultClient; - private HTTPClient _securityClient; - private String _serverUrl; - private String _language; - private String _sdkVersion; - private String _genVersion; + private SDKConfiguration sdkConfiguration; - public Streams(HTTPClient defaultClient, HTTPClient securityClient, String serverUrl, String language, String sdkVersion, String genVersion) { - this._defaultClient = defaultClient; - this._securityClient = securityClient; - this._serverUrl = serverUrl; - this._language = language; - this._sdkVersion = sdkVersion; - this._genVersion = genVersion; + public Streams(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } /** @@ -37,7 +27,7 @@ public Streams(HTTPClient defaultClient, HTTPClient securityClient, String serve * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.GetStreamPropertiesResponse getStreamProperties(com.airbyte.api.models.operations.GetStreamPropertiesRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/streams"); HTTPRequest req = new HTTPRequest(); @@ -45,7 +35,7 @@ public com.airbyte.api.models.operations.GetStreamPropertiesResponse getStreamPr req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); java.util.List queryParams = com.airbyte.api.utils.Utils.getQueryParams(com.airbyte.api.models.operations.GetStreamPropertiesRequest.class, request, null); if (queryParams != null) { for (NameValuePair queryParam : queryParams) { @@ -53,7 +43,7 @@ public com.airbyte.api.models.operations.GetStreamPropertiesResponse getStreamPr } } - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); diff --git a/lib/src/main/java/com/airbyte/api/Workspaces.java b/lib/src/main/java/com/airbyte/api/Workspaces.java index dbba365a3..1f2398b50 100755 --- a/lib/src/main/java/com/airbyte/api/Workspaces.java +++ b/lib/src/main/java/com/airbyte/api/Workspaces.java @@ -15,20 +15,10 @@ public class Workspaces { - private HTTPClient _defaultClient; - private HTTPClient _securityClient; - private String _serverUrl; - private String _language; - private String _sdkVersion; - private String _genVersion; - - public Workspaces(HTTPClient defaultClient, HTTPClient securityClient, String serverUrl, String language, String sdkVersion, String genVersion) { - this._defaultClient = defaultClient; - this._securityClient = securityClient; - this._serverUrl = serverUrl; - this._language = language; - this._sdkVersion = sdkVersion; - this._genVersion = genVersion; + private SDKConfiguration sdkConfiguration; + + public Workspaces(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } /** @@ -40,7 +30,7 @@ public Workspaces(HTTPClient defaultClient, HTTPClient securityClient, String se * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.CreateOrUpdateWorkspaceOAuthCredentialsResponse createOrUpdateWorkspaceOAuthCredentials(com.airbyte.api.models.operations.CreateOrUpdateWorkspaceOAuthCredentialsRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.CreateOrUpdateWorkspaceOAuthCredentialsRequest.class, baseUrl, "/workspaces/{workspaceId}/oauthCredentials", request, null); HTTPRequest req = new HTTPRequest(); @@ -53,9 +43,9 @@ public com.airbyte.api.models.operations.CreateOrUpdateWorkspaceOAuthCredentials req.setBody(serializedRequestBody); req.addHeader("Accept", "*/*"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -78,7 +68,7 @@ public com.airbyte.api.models.operations.CreateOrUpdateWorkspaceOAuthCredentials * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.CreateWorkspaceResponse createWorkspace(com.airbyte.api.models.shared.WorkspaceCreateRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/workspaces"); HTTPRequest req = new HTTPRequest(); @@ -91,9 +81,9 @@ public com.airbyte.api.models.operations.CreateWorkspaceResponse createWorkspace req.setBody(serializedRequestBody); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -124,7 +114,7 @@ else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 403) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.DeleteWorkspaceResponse deleteWorkspace(com.airbyte.api.models.operations.DeleteWorkspaceRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.DeleteWorkspaceRequest.class, baseUrl, "/workspaces/{workspaceId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -132,9 +122,9 @@ public com.airbyte.api.models.operations.DeleteWorkspaceResponse deleteWorkspace req.setURL(url); req.addHeader("Accept", "*/*"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -157,7 +147,7 @@ public com.airbyte.api.models.operations.DeleteWorkspaceResponse deleteWorkspace * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.GetWorkspaceResponse getWorkspace(com.airbyte.api.models.operations.GetWorkspaceRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.GetWorkspaceRequest.class, baseUrl, "/workspaces/{workspaceId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -165,9 +155,9 @@ public com.airbyte.api.models.operations.GetWorkspaceResponse getWorkspace(com.a req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -198,7 +188,7 @@ else if (httpRes.statusCode() == 403 || httpRes.statusCode() == 404) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.ListWorkspacesResponse listWorkspaces(com.airbyte.api.models.operations.ListWorkspacesRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/workspaces"); HTTPRequest req = new HTTPRequest(); @@ -206,7 +196,7 @@ public com.airbyte.api.models.operations.ListWorkspacesResponse listWorkspaces(c req.setURL(url); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); java.util.List queryParams = com.airbyte.api.utils.Utils.getQueryParams(com.airbyte.api.models.operations.ListWorkspacesRequest.class, request, null); if (queryParams != null) { for (NameValuePair queryParam : queryParams) { @@ -214,7 +204,7 @@ public com.airbyte.api.models.operations.ListWorkspacesResponse listWorkspaces(c } } - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req); @@ -245,7 +235,7 @@ else if (httpRes.statusCode() == 403 || httpRes.statusCode() == 404) { * @throws Exception if the API call fails */ public com.airbyte.api.models.operations.UpdateWorkspaceResponse updateWorkspace(com.airbyte.api.models.operations.UpdateWorkspaceRequest request) throws Exception { - String baseUrl = this._serverUrl; + String baseUrl = this.sdkConfiguration.serverUrl; String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.UpdateWorkspaceRequest.class, baseUrl, "/workspaces/{workspaceId}", request, null); HTTPRequest req = new HTTPRequest(); @@ -258,9 +248,9 @@ public com.airbyte.api.models.operations.UpdateWorkspaceResponse updateWorkspace req.setBody(serializedRequestBody); req.addHeader("Accept", "application/json"); - req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion)); + req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion)); - HTTPClient client = this._securityClient; + HTTPClient client = this.sdkConfiguration.securityClient; HttpResponse httpRes = client.send(req);