@@ -110,63 +110,41 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
110
110
To change the default retry strategy for a single API call, simply provide a ` RetryConfig ` object to the call:
111
111
``` python
112
112
from unstructured_client import UnstructuredClient
113
- from unstructured_client.models import shared
114
113
from unstructured_client.utils import BackoffStrategy, RetryConfig
115
114
116
115
117
116
with UnstructuredClient() as uc_client:
118
117
119
- res = uc_client.destinations.create_destination(request = {
120
- " create_destination_connector" : {
121
- " config" : {
122
- " api_endpoint" : " <value>" ,
123
- " batch_size" : 20 ,
124
- " collection_name" : " <value>" ,
125
- " flatten_metadata" : False ,
126
- " token" : " <value>" ,
127
- },
128
- " name" : " <value>" ,
129
- " type" : shared.DestinationConnectorType.AZURE ,
130
- },
118
+ res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request = {
119
+ " destination_id" : " b65169f5-79ba-4464-918f-b0be2c07b962" ,
131
120
},
132
121
RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ))
133
122
134
- assert res.destination_connector_information is not None
123
+ assert res.dag_node_connection_check is not None
135
124
136
125
# Handle response
137
- print (res.destination_connector_information )
126
+ print (res.dag_node_connection_check )
138
127
139
128
```
140
129
141
130
If you'd like to override the default retry strategy for all operations that support retries, you can use the ` retry_config ` optional parameter when initializing the SDK:
142
131
``` python
143
132
from unstructured_client import UnstructuredClient
144
- from unstructured_client.models import shared
145
133
from unstructured_client.utils import BackoffStrategy, RetryConfig
146
134
147
135
148
136
with UnstructuredClient(
149
137
retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
150
138
) as uc_client:
151
139
152
- res = uc_client.destinations.create_destination(request = {
153
- " create_destination_connector" : {
154
- " config" : {
155
- " api_endpoint" : " <value>" ,
156
- " batch_size" : 20 ,
157
- " collection_name" : " <value>" ,
158
- " flatten_metadata" : False ,
159
- " token" : " <value>" ,
160
- },
161
- " name" : " <value>" ,
162
- " type" : shared.DestinationConnectorType.AZURE ,
163
- },
140
+ res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request = {
141
+ " destination_id" : " b65169f5-79ba-4464-918f-b0be2c07b962" ,
164
142
})
165
143
166
- assert res.destination_connector_information is not None
144
+ assert res.dag_node_connection_check is not None
167
145
168
146
# Handle response
169
- print (res.destination_connector_information )
147
+ print (res.dag_node_connection_check )
170
148
171
149
```
172
150
<!-- End Retries [retries] -->
@@ -186,7 +164,7 @@ By default, an API error will raise a errors.SDKError exception, which has the f
186
164
| ` .raw_response ` | * httpx.Response* | The raw HTTP response |
187
165
| ` .body ` | * str* | The response content |
188
166
189
- When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective * Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the ` create_destination_async ` method may raise the following exceptions:
167
+ When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective * Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the ` check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async ` method may raise the following exceptions:
190
168
191
169
| Error Type | Status Code | Content Type |
192
170
| -------------------------- | ----------- | ---------------- |
@@ -197,31 +175,21 @@ When custom error responses are specified for an operation, the SDK may also rai
197
175
198
176
``` python
199
177
from unstructured_client import UnstructuredClient
200
- from unstructured_client.models import errors, shared
178
+ from unstructured_client.models import errors
201
179
202
180
203
181
with UnstructuredClient() as uc_client:
204
182
res = None
205
183
try :
206
184
207
- res = uc_client.destinations.create_destination(request = {
208
- " create_destination_connector" : {
209
- " config" : {
210
- " api_endpoint" : " <value>" ,
211
- " batch_size" : 20 ,
212
- " collection_name" : " <value>" ,
213
- " flatten_metadata" : False ,
214
- " token" : " <value>" ,
215
- },
216
- " name" : " <value>" ,
217
- " type" : shared.DestinationConnectorType.AZURE ,
218
- },
185
+ res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request = {
186
+ " destination_id" : " b65169f5-79ba-4464-918f-b0be2c07b962" ,
219
187
})
220
188
221
- assert res.destination_connector_information is not None
189
+ assert res.dag_node_connection_check is not None
222
190
223
191
# Handle response
224
- print (res.destination_connector_information )
192
+ print (res.dag_node_connection_check )
225
193
226
194
except errors.HTTPValidationError as e:
227
195
# handle e.data: errors.HTTPValidationErrorData
@@ -332,29 +300,18 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
332
300
``` python
333
301
# Synchronous Example
334
302
from unstructured_client import UnstructuredClient
335
- from unstructured_client.models import shared
336
303
337
304
338
305
with UnstructuredClient() as uc_client:
339
306
340
- res = uc_client.destinations.create_destination(request = {
341
- " create_destination_connector" : {
342
- " config" : {
343
- " api_endpoint" : " <value>" ,
344
- " batch_size" : 20 ,
345
- " collection_name" : " <value>" ,
346
- " flatten_metadata" : False ,
347
- " token" : " <value>" ,
348
- },
349
- " name" : " <value>" ,
350
- " type" : shared.DestinationConnectorType.AZURE ,
351
- },
307
+ res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request = {
308
+ " destination_id" : " b65169f5-79ba-4464-918f-b0be2c07b962" ,
352
309
})
353
310
354
- assert res.destination_connector_information is not None
311
+ assert res.dag_node_connection_check is not None
355
312
356
313
# Handle response
357
- print (res.destination_connector_information )
314
+ print (res.dag_node_connection_check )
358
315
```
359
316
360
317
</br >
@@ -364,30 +321,19 @@ The same SDK client can also be used to make asychronous requests by importing a
364
321
# Asynchronous Example
365
322
import asyncio
366
323
from unstructured_client import UnstructuredClient
367
- from unstructured_client.models import shared
368
324
369
325
async def main ():
370
326
371
327
async with UnstructuredClient() as uc_client:
372
328
373
- res = await uc_client.destinations.create_destination_async(request = {
374
- " create_destination_connector" : {
375
- " config" : {
376
- " api_endpoint" : " <value>" ,
377
- " batch_size" : 20 ,
378
- " collection_name" : " <value>" ,
379
- " flatten_metadata" : False ,
380
- " token" : " <value>" ,
381
- },
382
- " name" : " <value>" ,
383
- " type" : shared.DestinationConnectorType.AZURE ,
384
- },
329
+ res = await uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async(request = {
330
+ " destination_id" : " b65169f5-79ba-4464-918f-b0be2c07b962" ,
385
331
})
386
332
387
- assert res.destination_connector_information is not None
333
+ assert res.dag_node_connection_check is not None
388
334
389
335
# Handle response
390
- print (res.destination_connector_information )
336
+ print (res.dag_node_connection_check )
391
337
392
338
asyncio.run(main())
393
339
```
0 commit comments