@@ -110,63 +110,41 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
110110To change the default retry strategy for a single API call, simply provide a ` RetryConfig ` object to the call:
111111``` python
112112from unstructured_client import UnstructuredClient
113- from unstructured_client.models import shared
114113from unstructured_client.utils import BackoffStrategy, RetryConfig
115114
116115
117116with UnstructuredClient() as uc_client:
118117
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" ,
131120 },
132121 RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ))
133122
134- assert res.destination_connector_information is not None
123+ assert res.dag_node_connection_check is not None
135124
136125 # Handle response
137- print (res.destination_connector_information )
126+ print (res.dag_node_connection_check )
138127
139128```
140129
141130If 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:
142131``` python
143132from unstructured_client import UnstructuredClient
144- from unstructured_client.models import shared
145133from unstructured_client.utils import BackoffStrategy, RetryConfig
146134
147135
148136with UnstructuredClient(
149137 retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
150138) as uc_client:
151139
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" ,
164142 })
165143
166- assert res.destination_connector_information is not None
144+ assert res.dag_node_connection_check is not None
167145
168146 # Handle response
169- print (res.destination_connector_information )
147+ print (res.dag_node_connection_check )
170148
171149```
172150<!-- End Retries [retries] -->
@@ -186,7 +164,7 @@ By default, an API error will raise a errors.SDKError exception, which has the f
186164| ` .raw_response ` | * httpx.Response* | The raw HTTP response |
187165| ` .body ` | * str* | The response content |
188166
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:
190168
191169| Error Type | Status Code | Content Type |
192170| -------------------------- | ----------- | ---------------- |
@@ -197,31 +175,21 @@ When custom error responses are specified for an operation, the SDK may also rai
197175
198176``` python
199177from unstructured_client import UnstructuredClient
200- from unstructured_client.models import errors, shared
178+ from unstructured_client.models import errors
201179
202180
203181with UnstructuredClient() as uc_client:
204182 res = None
205183 try :
206184
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" ,
219187 })
220188
221- assert res.destination_connector_information is not None
189+ assert res.dag_node_connection_check is not None
222190
223191 # Handle response
224- print (res.destination_connector_information )
192+ print (res.dag_node_connection_check )
225193
226194 except errors.HTTPValidationError as e:
227195 # 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
332300``` python
333301# Synchronous Example
334302from unstructured_client import UnstructuredClient
335- from unstructured_client.models import shared
336303
337304
338305with UnstructuredClient() as uc_client:
339306
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" ,
352309 })
353310
354- assert res.destination_connector_information is not None
311+ assert res.dag_node_connection_check is not None
355312
356313 # Handle response
357- print (res.destination_connector_information )
314+ print (res.dag_node_connection_check )
358315```
359316
360317</br >
@@ -364,30 +321,19 @@ The same SDK client can also be used to make asychronous requests by importing a
364321# Asynchronous Example
365322import asyncio
366323from unstructured_client import UnstructuredClient
367- from unstructured_client.models import shared
368324
369325async def main ():
370326
371327 async with UnstructuredClient() as uc_client:
372328
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" ,
385331 })
386332
387- assert res.destination_connector_information is not None
333+ assert res.dag_node_connection_check is not None
388334
389335 # Handle response
390- print (res.destination_connector_information )
336+ print (res.dag_node_connection_check )
391337
392338asyncio.run(main())
393339```
0 commit comments