@@ -27,19 +27,19 @@ pip install airbyte-api
27
27
### Example
28
28
29
29
``` python
30
- import airbyte
31
- from airbyte.models import shared
30
+ import airbyte_api
31
+ from airbyte_api import models
32
32
33
- s = airbyte.Airbyte (
34
- security = shared .Security(
35
- basic_auth = shared .SchemeBasicAuth(
33
+ s = airbyte_api.AirbyteAPI (
34
+ security = models .Security(
35
+ basic_auth = models .SchemeBasicAuth(
36
36
password = " <YOUR_PASSWORD_HERE>" ,
37
37
username = " <YOUR_USERNAME_HERE>" ,
38
38
),
39
39
),
40
40
)
41
41
42
- req = shared .ConnectionCreateRequest(
42
+ req = models .ConnectionCreateRequest(
43
43
destination_id = ' c669dd1e-3620-483e-afc8-55914e0a570f' ,
44
44
source_id = ' 6dd427d8-3a55-4584-b835-842325b6c7b3' ,
45
45
namespace_format = ' ${SOURCE_NAMESPACE} ' ,
@@ -50,6 +50,7 @@ res = s.connections.create_connection(req)
50
50
if res.connection_response is not None :
51
51
# handle response
52
52
pass
53
+
53
54
```
54
55
<!-- End SDK Example Usage [usage] -->
55
56
@@ -117,24 +118,24 @@ Handling errors in this SDK should largely match your expectations. All operati
117
118
118
119
| Error Object | Status Code | Content Type |
119
120
| --------------- | --------------- | --------------- |
120
- | errors.SDKError | 4x -5xx | * /* |
121
+ | errors.SDKError | 4xx -5xx | * /* |
121
122
122
123
### Example
123
124
124
125
``` python
125
- import airbyte
126
- from airbyte.models import errors, shared
126
+ import airbyte_api
127
+ from airbyte_api import errors, models
127
128
128
- s = airbyte.Airbyte (
129
- security = shared .Security(
130
- basic_auth = shared .SchemeBasicAuth(
129
+ s = airbyte_api.AirbyteAPI (
130
+ security = models .Security(
131
+ basic_auth = models .SchemeBasicAuth(
131
132
password = " <YOUR_PASSWORD_HERE>" ,
132
133
username = " <YOUR_USERNAME_HERE>" ,
133
134
),
134
135
),
135
136
)
136
137
137
- req = shared .ConnectionCreateRequest(
138
+ req = models .ConnectionCreateRequest(
138
139
destination_id = ' c669dd1e-3620-483e-afc8-55914e0a570f' ,
139
140
source_id = ' 6dd427d8-3a55-4584-b835-842325b6c7b3' ,
140
141
namespace_format = ' ${SOURCE_NAMESPACE} ' ,
@@ -150,6 +151,7 @@ except errors.SDKError as e:
150
151
if res.connection_response is not None :
151
152
# handle response
152
153
pass
154
+
153
155
```
154
156
<!-- End Error Handling [errors] -->
155
157
@@ -169,20 +171,20 @@ You can override the default server globally by passing a server index to the `s
169
171
#### Example
170
172
171
173
``` python
172
- import airbyte
173
- from airbyte.models import shared
174
+ import airbyte_api
175
+ from airbyte_api import models
174
176
175
- s = airbyte.Airbyte (
177
+ s = airbyte_api.AirbyteAPI (
176
178
server_idx = 0 ,
177
- security = shared .Security(
178
- basic_auth = shared .SchemeBasicAuth(
179
+ security = models .Security(
180
+ basic_auth = models .SchemeBasicAuth(
179
181
password = " <YOUR_PASSWORD_HERE>" ,
180
182
username = " <YOUR_USERNAME_HERE>" ,
181
183
),
182
184
),
183
185
)
184
186
185
- req = shared .ConnectionCreateRequest(
187
+ req = models .ConnectionCreateRequest(
186
188
destination_id = ' c669dd1e-3620-483e-afc8-55914e0a570f' ,
187
189
source_id = ' 6dd427d8-3a55-4584-b835-842325b6c7b3' ,
188
190
namespace_format = ' ${SOURCE_NAMESPACE} ' ,
@@ -193,27 +195,28 @@ res = s.connections.create_connection(req)
193
195
if res.connection_response is not None :
194
196
# handle response
195
197
pass
198
+
196
199
```
197
200
198
201
199
202
### Override Server URL Per-Client
200
203
201
204
The default server can also be overridden globally by passing a URL to the ` server_url: str ` optional parameter when initializing the SDK client instance. For example:
202
205
``` python
203
- import airbyte
204
- from airbyte.models import shared
206
+ import airbyte_api
207
+ from airbyte_api import models
205
208
206
- s = airbyte.Airbyte (
209
+ s = airbyte_api.AirbyteAPI (
207
210
server_url = " https://api.airbyte.com/v1" ,
208
- security = shared .Security(
209
- basic_auth = shared .SchemeBasicAuth(
211
+ security = models .Security(
212
+ basic_auth = models .SchemeBasicAuth(
210
213
password = " <YOUR_PASSWORD_HERE>" ,
211
214
username = " <YOUR_USERNAME_HERE>" ,
212
215
),
213
216
),
214
217
)
215
218
216
- req = shared .ConnectionCreateRequest(
219
+ req = models .ConnectionCreateRequest(
217
220
destination_id = ' c669dd1e-3620-483e-afc8-55914e0a570f' ,
218
221
source_id = ' 6dd427d8-3a55-4584-b835-842325b6c7b3' ,
219
222
namespace_format = ' ${SOURCE_NAMESPACE} ' ,
@@ -224,6 +227,7 @@ res = s.connections.create_connection(req)
224
227
if res.connection_response is not None :
225
228
# handle response
226
229
pass
230
+
227
231
```
228
232
<!-- End Server Selection [server] -->
229
233
@@ -236,12 +240,12 @@ The Python SDK makes API calls using the [requests](https://pypi.org/project/req
236
240
237
241
For example, you could specify a header for every request that this sdk makes as follows:
238
242
``` python
239
- import airbyte
243
+ import airbyte_api
240
244
import requests
241
245
242
246
http_client = requests.Session()
243
247
http_client.headers.update({' x-custom-header' : ' someValue' })
244
- s = airbyte.Airbyte (client: http_client)
248
+ s = airbyte_api.AirbyteAPI (client = http_client)
245
249
```
246
250
<!-- End Custom HTTP Client [http-client] -->
247
251
@@ -261,19 +265,19 @@ This SDK supports the following security schemes globally:
261
265
262
266
You can set the security parameters through the ` security ` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
263
267
``` python
264
- import airbyte
265
- from airbyte.models import shared
268
+ import airbyte_api
269
+ from airbyte_api import models
266
270
267
- s = airbyte.Airbyte (
268
- security = shared .Security(
269
- basic_auth = shared .SchemeBasicAuth(
271
+ s = airbyte_api.AirbyteAPI (
272
+ security = models .Security(
273
+ basic_auth = models .SchemeBasicAuth(
270
274
password = " <YOUR_PASSWORD_HERE>" ,
271
275
username = " <YOUR_USERNAME_HERE>" ,
272
276
),
273
277
),
274
278
)
275
279
276
- req = shared .ConnectionCreateRequest(
280
+ req = models .ConnectionCreateRequest(
277
281
destination_id = ' c669dd1e-3620-483e-afc8-55914e0a570f' ,
278
282
source_id = ' 6dd427d8-3a55-4584-b835-842325b6c7b3' ,
279
283
namespace_format = ' ${SOURCE_NAMESPACE} ' ,
@@ -284,6 +288,7 @@ res = s.connections.create_connection(req)
284
288
if res.connection_response is not None :
285
289
# handle response
286
290
pass
291
+
287
292
```
288
293
<!-- End Authentication [security] -->
289
294
0 commit comments