1515
1616public 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