Skip to content

Commit e821ed4

Browse files
authored
Merge pull request #35 from airbytehq/speakeasy-sdk-regen-1685751164
chore: speakeasy sdk regeneration - Generate
2 parents 2d8440d + 2125b74 commit e821ed4

File tree

13 files changed

+178
-255
lines changed

13 files changed

+178
-255
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The Developer Portal UI can also be used to help build your integration by showi
2121
### Gradle
2222

2323
```groovy
24-
implementation 'com.airbyte.api:public-api:0.14.2'
24+
implementation 'com.airbyte.api:public-api:0.15.0'
2525
```
2626
<!-- End SDK Installation -->
2727

RELEASES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,12 @@ Based on:
343343
- OpenAPI Doc 1.0.0
344344
- Speakeasy CLI 1.40.3 (2.34.7) https://github.com/speakeasy-api/speakeasy
345345
### Releases
346-
- [Maven Central v0.14.2] https://central.sonatype.com/artifact/com.airbyte/api/0.14.2 - .
346+
- [Maven Central v0.14.2] https://central.sonatype.com/artifact/com.airbyte/api/0.14.2 - .
347+
348+
## 2023-06-03 00:12:41
349+
### Changes
350+
Based on:
351+
- OpenAPI Doc 1.0.0
352+
- Speakeasy CLI 1.43.0 (2.35.3) https://github.com/speakeasy-api/speakeasy
353+
### Releases
354+
- [Maven Central v0.15.0] https://central.sonatype.com/artifact/com.airbyte/api/0.15.0 - .

files.gen

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
lib/src/main/java/com/airbyte/api/SDKConfiguration.java
12
lib/src/main/java/com/airbyte/api/Connections.java
23
lib/src/main/java/com/airbyte/api/Destinations.java
34
lib/src/main/java/com/airbyte/api/Jobs.java

gen.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ configVersion: 1.0.0
22
management:
33
docChecksum: e82f3e11abf47c2509f115468e75bb06
44
docVersion: 1.0.0
5-
speakeasyVersion: 1.40.3
6-
generationVersion: 2.34.7
5+
speakeasyVersion: 1.43.0
6+
generationVersion: 2.35.3
77
generation:
88
sdkClassName: airbyte
99
singleTagPerOp: false
1010
telemetryEnabled: true
1111
java:
12-
version: 0.14.2
12+
version: 0.15.0
1313
artifactID: api
1414
companyEmail: [email protected]
1515
companyName: Airbyte

lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ publishing {
4141
maven(MavenPublication) {
4242
groupId = 'com.airbyte'
4343
artifactId = 'api'
44-
version = '0.14.2'
44+
version = '0.15.0'
4545

4646
from components.java
4747

lib/src/main/java/com/airbyte/api/Airbyte.java

Lines changed: 48 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,13 @@ public class Airbyte {
2525
public Streams streams;
2626
public Workspaces workspaces;
2727

28-
private HTTPClient _defaultClient;
29-
private HTTPClient _securityClient;
30-
private com.airbyte.api.models.shared.Security _security;
31-
private String _serverUrl;
32-
private String _language = "java";
33-
private String _sdkVersion = "0.14.2";
34-
private String _genVersion = "2.34.7";
28+
private SDKConfiguration sdkConfiguration;
29+
3530
/**
3631
* The Builder class allows the configuration of a new instance of the SDK.
3732
*/
3833
public static class Builder {
39-
private HTTPClient client;
40-
private com.airbyte.api.models.shared.Security security;
41-
private String serverUrl;
42-
private java.util.Map<String, String> params = new java.util.HashMap<String, String>();
34+
private SDKConfiguration sdkConfiguration = new SDKConfiguration();
4335

4436
private Builder() {
4537
}
@@ -50,7 +42,7 @@ private Builder() {
5042
* @return The builder instance.
5143
*/
5244
public Builder setClient(HTTPClient client) {
53-
this.client = client;
45+
this.sdkConfiguration.defaultClient = client;
5446
return this;
5547
}
5648

@@ -60,7 +52,7 @@ public Builder setClient(HTTPClient client) {
6052
* @return The builder instance.
6153
*/
6254
public Builder setSecurity(com.airbyte.api.models.shared.Security security) {
63-
this.security = security;
55+
this.sdkConfiguration.security = security;
6456
return this;
6557
}
6658

@@ -70,7 +62,7 @@ public Builder setSecurity(com.airbyte.api.models.shared.Security security) {
7062
* @return The builder instance.
7163
*/
7264
public Builder setServerURL(String serverUrl) {
73-
this.serverUrl = serverUrl;
65+
this.sdkConfiguration.serverUrl = serverUrl;
7466
return this;
7567
}
7668

@@ -81,8 +73,18 @@ public Builder setServerURL(String serverUrl) {
8173
* @return The builder instance.
8274
*/
8375
public Builder setServerURL(String serverUrl, java.util.Map<String, String> params) {
84-
this.serverUrl = serverUrl;
85-
this.params = params;
76+
this.sdkConfiguration.serverUrl = com.airbyte.api.utils.Utils.templateUrl(serverUrl, params);
77+
return this;
78+
}
79+
80+
/**
81+
* Allows the overriding of the default server by index
82+
* @param serverIdx The server to use for all requests.
83+
* @return The builder instance.
84+
*/
85+
public Builder setServerIndex(int serverIdx) {
86+
this.sdkConfiguration.serverIdx = serverIdx;
87+
this.sdkConfiguration.serverUrl = SERVERS[serverIdx];
8688
return this;
8789
}
8890

@@ -92,7 +94,28 @@ public Builder setServerURL(String serverUrl, java.util.Map<String, String> para
9294
* @throws Exception Thrown if the SDK could not be built.
9395
*/
9496
public Airbyte build() throws Exception {
95-
return new Airbyte(this.client, this.security, this.serverUrl, this.params);
97+
if (this.sdkConfiguration.defaultClient == null) {
98+
this.sdkConfiguration.defaultClient = new SpeakeasyHTTPClient();
99+
}
100+
101+
if (this.sdkConfiguration.security != null) {
102+
this.sdkConfiguration.securityClient = com.airbyte.api.utils.Utils.configureSecurityClient(this.sdkConfiguration.defaultClient, this.sdkConfiguration.security);
103+
}
104+
105+
if (this.sdkConfiguration.securityClient == null) {
106+
this.sdkConfiguration.securityClient = this.sdkConfiguration.defaultClient;
107+
}
108+
109+
if (this.sdkConfiguration.serverUrl == null || this.sdkConfiguration.serverUrl.isBlank()) {
110+
this.sdkConfiguration.serverUrl = SERVERS[0];
111+
this.sdkConfiguration.serverIdx = 0;
112+
}
113+
114+
if (this.sdkConfiguration.serverUrl.endsWith("/")) {
115+
this.sdkConfiguration.serverUrl = this.sdkConfiguration.serverUrl.substring(0, this.sdkConfiguration.serverUrl.length() - 1);
116+
}
117+
118+
return new Airbyte(this.sdkConfiguration);
96119
}
97120
}
98121

@@ -104,88 +127,19 @@ public static Builder builder() {
104127
return new Builder();
105128
}
106129

107-
private Airbyte(HTTPClient client, com.airbyte.api.models.shared.Security security, String serverUrl, java.util.Map<String, String> params) throws Exception {
108-
this._defaultClient = client;
109-
110-
if (this._defaultClient == null) {
111-
this._defaultClient = new SpeakeasyHTTPClient();
112-
}
113-
114-
if (security != null) {
115-
this._security = security;
116-
this._securityClient = com.airbyte.api.utils.Utils.configureSecurityClient(this._defaultClient, this._security);
117-
}
118-
119-
if (this._securityClient == null) {
120-
this._securityClient = this._defaultClient;
121-
}
122-
123-
if (serverUrl != null && !serverUrl.isBlank()) {
124-
this._serverUrl = com.airbyte.api.utils.Utils.templateUrl(serverUrl, params);
125-
}
126-
127-
if (this._serverUrl == null) {
128-
this._serverUrl = SERVERS[0];
129-
}
130-
131-
if (this._serverUrl.endsWith("/")) {
132-
this._serverUrl = this._serverUrl.substring(0, this._serverUrl.length() - 1);
133-
}
134-
135-
130+
private Airbyte(SDKConfiguration sdkConfiguration) throws Exception {
131+
this.sdkConfiguration = sdkConfiguration;
136132

137-
this.connections = new Connections(
138-
this._defaultClient,
139-
this._securityClient,
140-
this._serverUrl,
141-
this._language,
142-
this._sdkVersion,
143-
this._genVersion
144-
);
133+
this.connections = new Connections(this.sdkConfiguration);
145134

146-
this.destinations = new Destinations(
147-
this._defaultClient,
148-
this._securityClient,
149-
this._serverUrl,
150-
this._language,
151-
this._sdkVersion,
152-
this._genVersion
153-
);
135+
this.destinations = new Destinations(this.sdkConfiguration);
154136

155-
this.jobs = new Jobs(
156-
this._defaultClient,
157-
this._securityClient,
158-
this._serverUrl,
159-
this._language,
160-
this._sdkVersion,
161-
this._genVersion
162-
);
137+
this.jobs = new Jobs(this.sdkConfiguration);
163138

164-
this.sources = new Sources(
165-
this._defaultClient,
166-
this._securityClient,
167-
this._serverUrl,
168-
this._language,
169-
this._sdkVersion,
170-
this._genVersion
171-
);
139+
this.sources = new Sources(this.sdkConfiguration);
172140

173-
this.streams = new Streams(
174-
this._defaultClient,
175-
this._securityClient,
176-
this._serverUrl,
177-
this._language,
178-
this._sdkVersion,
179-
this._genVersion
180-
);
141+
this.streams = new Streams(this.sdkConfiguration);
181142

182-
this.workspaces = new Workspaces(
183-
this._defaultClient,
184-
this._securityClient,
185-
this._serverUrl,
186-
this._language,
187-
this._sdkVersion,
188-
this._genVersion
189-
);
143+
this.workspaces = new Workspaces(this.sdkConfiguration);
190144
}
191145
}

lib/src/main/java/com/airbyte/api/Connections.java

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,10 @@
1515

1616
public class Connections {
1717

18-
private HTTPClient _defaultClient;
19-
private HTTPClient _securityClient;
20-
private String _serverUrl;
21-
private String _language;
22-
private String _sdkVersion;
23-
private String _genVersion;
24-
25-
public Connections(HTTPClient defaultClient, HTTPClient securityClient, String serverUrl, String language, String sdkVersion, String genVersion) {
26-
this._defaultClient = defaultClient;
27-
this._securityClient = securityClient;
28-
this._serverUrl = serverUrl;
29-
this._language = language;
30-
this._sdkVersion = sdkVersion;
31-
this._genVersion = genVersion;
18+
private SDKConfiguration sdkConfiguration;
19+
20+
public Connections(SDKConfiguration sdkConfiguration) {
21+
this.sdkConfiguration = sdkConfiguration;
3222
}
3323

3424
/**
@@ -38,7 +28,7 @@ public Connections(HTTPClient defaultClient, HTTPClient securityClient, String s
3828
* @throws Exception if the API call fails
3929
*/
4030
public com.airbyte.api.models.operations.CreateConnectionResponse createConnection(com.airbyte.api.models.shared.ConnectionCreateRequest request) throws Exception {
41-
String baseUrl = this._serverUrl;
31+
String baseUrl = this.sdkConfiguration.serverUrl;
4232
String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/connections");
4333

4434
HTTPRequest req = new HTTPRequest();
@@ -51,9 +41,9 @@ public com.airbyte.api.models.operations.CreateConnectionResponse createConnecti
5141
req.setBody(serializedRequestBody);
5242

5343
req.addHeader("Accept", "application/json");
54-
req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion));
44+
req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion));
5545

56-
HTTPClient client = this._securityClient;
46+
HTTPClient client = this.sdkConfiguration.securityClient;
5747

5848
HttpResponse<byte[]> httpRes = client.send(req);
5949

@@ -84,17 +74,17 @@ else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 403) {
8474
* @throws Exception if the API call fails
8575
*/
8676
public com.airbyte.api.models.operations.DeleteConnectionResponse deleteConnection(com.airbyte.api.models.operations.DeleteConnectionRequest request) throws Exception {
87-
String baseUrl = this._serverUrl;
77+
String baseUrl = this.sdkConfiguration.serverUrl;
8878
String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.DeleteConnectionRequest.class, baseUrl, "/connections/{connectionId}", request, null);
8979

9080
HTTPRequest req = new HTTPRequest();
9181
req.setMethod("DELETE");
9282
req.setURL(url);
9383

9484
req.addHeader("Accept", "*/*");
95-
req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion));
85+
req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion));
9686

97-
HTTPClient client = this._securityClient;
87+
HTTPClient client = this.sdkConfiguration.securityClient;
9888

9989
HttpResponse<byte[]> httpRes = client.send(req);
10090

@@ -117,17 +107,17 @@ public com.airbyte.api.models.operations.DeleteConnectionResponse deleteConnecti
117107
* @throws Exception if the API call fails
118108
*/
119109
public com.airbyte.api.models.operations.GetConnectionResponse getConnection(com.airbyte.api.models.operations.GetConnectionRequest request) throws Exception {
120-
String baseUrl = this._serverUrl;
110+
String baseUrl = this.sdkConfiguration.serverUrl;
121111
String url = com.airbyte.api.utils.Utils.generateURL(com.airbyte.api.models.operations.GetConnectionRequest.class, baseUrl, "/connections/{connectionId}", request, null);
122112

123113
HTTPRequest req = new HTTPRequest();
124114
req.setMethod("GET");
125115
req.setURL(url);
126116

127117
req.addHeader("Accept", "application/json");
128-
req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion));
118+
req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion));
129119

130-
HTTPClient client = this._securityClient;
120+
HTTPClient client = this.sdkConfiguration.securityClient;
131121

132122
HttpResponse<byte[]> httpRes = client.send(req);
133123

@@ -158,23 +148,23 @@ else if (httpRes.statusCode() == 403 || httpRes.statusCode() == 404) {
158148
* @throws Exception if the API call fails
159149
*/
160150
public com.airbyte.api.models.operations.ListConnectionsResponse listConnections(com.airbyte.api.models.operations.ListConnectionsRequest request) throws Exception {
161-
String baseUrl = this._serverUrl;
151+
String baseUrl = this.sdkConfiguration.serverUrl;
162152
String url = com.airbyte.api.utils.Utils.generateURL(baseUrl, "/connections");
163153

164154
HTTPRequest req = new HTTPRequest();
165155
req.setMethod("GET");
166156
req.setURL(url);
167157

168158
req.addHeader("Accept", "application/json");
169-
req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this._language, this._sdkVersion, this._genVersion));
159+
req.addHeader("user-agent", String.format("speakeasy-sdk/%s %s %s", this.sdkConfiguration.language, this.sdkConfiguration.sdkVersion, this.sdkConfiguration.genVersion));
170160
java.util.List<NameValuePair> queryParams = com.airbyte.api.utils.Utils.getQueryParams(com.airbyte.api.models.operations.ListConnectionsRequest.class, request, null);
171161
if (queryParams != null) {
172162
for (NameValuePair queryParam : queryParams) {
173163
req.addQueryParam(queryParam);
174164
}
175165
}
176166

177-
HTTPClient client = this._securityClient;
167+
HTTPClient client = this.sdkConfiguration.securityClient;
178168

179169
HttpResponse<byte[]> httpRes = client.send(req);
180170

0 commit comments

Comments
 (0)