@@ -110,41 +110,63 @@ 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
113114from unstructured_client.utils import BackoffStrategy, RetryConfig
114115
115116
116117with UnstructuredClient() as uc_client:
117118
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" ,
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_AI_SEARCH ,
130+ },
120131 },
121132 RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ))
122133
123- assert res.dag_node_connection_check is not None
134+ assert res.destination_connector_information is not None
124135
125136 # Handle response
126- print (res.dag_node_connection_check )
137+ print (res.destination_connector_information )
127138
128139```
129140
130141If 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:
131142``` python
132143from unstructured_client import UnstructuredClient
144+ from unstructured_client.models import shared
133145from unstructured_client.utils import BackoffStrategy, RetryConfig
134146
135147
136148with UnstructuredClient(
137149 retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
138150) as uc_client:
139151
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" ,
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_AI_SEARCH ,
163+ },
142164 })
143165
144- assert res.dag_node_connection_check is not None
166+ assert res.destination_connector_information is not None
145167
146168 # Handle response
147- print (res.dag_node_connection_check )
169+ print (res.destination_connector_information )
148170
149171```
150172<!-- End Retries [retries] -->
@@ -164,7 +186,7 @@ By default, an API error will raise a errors.SDKError exception, which has the f
164186| ` .raw_response ` | * httpx.Response* | The raw HTTP response |
165187| ` .body ` | * str* | The response content |
166188
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:
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:
168190
169191| Error Type | Status Code | Content Type |
170192| -------------------------- | ----------- | ---------------- |
@@ -175,21 +197,31 @@ When custom error responses are specified for an operation, the SDK may also rai
175197
176198``` python
177199from unstructured_client import UnstructuredClient
178- from unstructured_client.models import errors
200+ from unstructured_client.models import errors, shared
179201
180202
181203with UnstructuredClient() as uc_client:
182204 res = None
183205 try :
184206
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" ,
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_AI_SEARCH ,
218+ },
187219 })
188220
189- assert res.dag_node_connection_check is not None
221+ assert res.destination_connector_information is not None
190222
191223 # Handle response
192- print (res.dag_node_connection_check )
224+ print (res.destination_connector_information )
193225
194226 except errors.HTTPValidationError as e:
195227 # handle e.data: errors.HTTPValidationErrorData
@@ -300,18 +332,29 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
300332``` python
301333# Synchronous Example
302334from unstructured_client import UnstructuredClient
335+ from unstructured_client.models import shared
303336
304337
305338with UnstructuredClient() as uc_client:
306339
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" ,
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_AI_SEARCH ,
351+ },
309352 })
310353
311- assert res.dag_node_connection_check is not None
354+ assert res.destination_connector_information is not None
312355
313356 # Handle response
314- print (res.dag_node_connection_check )
357+ print (res.destination_connector_information )
315358```
316359
317360</br >
@@ -321,19 +364,30 @@ The same SDK client can also be used to make asychronous requests by importing a
321364# Asynchronous Example
322365import asyncio
323366from unstructured_client import UnstructuredClient
367+ from unstructured_client.models import shared
324368
325369async def main ():
326370
327371 async with UnstructuredClient() as uc_client:
328372
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" ,
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_AI_SEARCH ,
384+ },
331385 })
332386
333- assert res.dag_node_connection_check is not None
387+ assert res.destination_connector_information is not None
334388
335389 # Handle response
336- print (res.dag_node_connection_check )
390+ print (res.destination_connector_information )
337391
338392asyncio.run(main())
339393```
0 commit comments