You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -108,7 +108,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
108
108
<!-- Start SDK Example Usage [usage] -->
109
109
## SDK Example Usage
110
110
111
-
### Example
111
+
### Example 1
112
112
113
113
```python
114
114
# Synchronous Example
@@ -158,6 +158,205 @@ async def main():
158
158
# Handle response
159
159
print(res)
160
160
161
+
asyncio.run(main())
162
+
```
163
+
164
+
### Example 2
165
+
166
+
```python
167
+
# Synchronous Example
168
+
import ragie
169
+
from ragie import Ragie
170
+
171
+
172
+
with Ragie(
173
+
auth="<YOUR_BEARER_TOKEN_HERE>",
174
+
) as r_client:
175
+
176
+
res = r_client.connections.create_connection(request=ragie.PublicCreateConnection(
177
+
partition_strategy=ragie.MediaModeParam(),
178
+
page_limit=None,
179
+
config=None,
180
+
connection=ragie.PublicGCSConnection(
181
+
data=ragie.BucketData(
182
+
bucket="<value>",
183
+
),
184
+
credentials={
185
+
"key": "<value>",
186
+
"key1": "<value>",
187
+
},
188
+
),
189
+
))
190
+
191
+
assert res isnotNone
192
+
193
+
# Handle response
194
+
print(res)
195
+
```
196
+
197
+
</br>
198
+
199
+
The same SDK client can also be used to make asychronous requests by importing asyncio.
200
+
```python
201
+
# Asynchronous Example
202
+
import asyncio
203
+
import ragie
204
+
from ragie import Ragie
205
+
206
+
asyncdefmain():
207
+
208
+
asyncwith Ragie(
209
+
auth="<YOUR_BEARER_TOKEN_HERE>",
210
+
) as r_client:
211
+
212
+
res =await r_client.connections.create_connection_async(request=ragie.PublicCreateConnection(
213
+
partition_strategy=ragie.MediaModeParam(),
214
+
page_limit=None,
215
+
config=None,
216
+
connection=ragie.PublicGCSConnection(
217
+
data=ragie.BucketData(
218
+
bucket="<value>",
219
+
),
220
+
credentials={
221
+
"key": "<value>",
222
+
"key1": "<value>",
223
+
},
224
+
),
225
+
))
226
+
227
+
assert res isnotNone
228
+
229
+
# Handle response
230
+
print(res)
231
+
232
+
asyncio.run(main())
233
+
```
234
+
235
+
### Example 3
236
+
237
+
```python
238
+
# Synchronous Example
239
+
import ragie
240
+
from ragie import Ragie
241
+
242
+
243
+
with Ragie(
244
+
auth="<YOUR_BEARER_TOKEN_HERE>",
245
+
) as r_client:
246
+
247
+
res = r_client.authenticators.create(request={
248
+
"provider": ragie.Provider.ATLASSIAN,
249
+
"name": "<value>",
250
+
"client_id": "<id>",
251
+
"client_secret": "<value>",
252
+
})
253
+
254
+
assert res isnotNone
255
+
256
+
# Handle response
257
+
print(res)
258
+
```
259
+
260
+
</br>
261
+
262
+
The same SDK client can also be used to make asychronous requests by importing asyncio.
263
+
```python
264
+
# Asynchronous Example
265
+
import asyncio
266
+
import ragie
267
+
from ragie import Ragie
268
+
269
+
asyncdefmain():
270
+
271
+
asyncwith Ragie(
272
+
auth="<YOUR_BEARER_TOKEN_HERE>",
273
+
) as r_client:
274
+
275
+
res =await r_client.authenticators.create_async(request={
276
+
"provider": ragie.Provider.ATLASSIAN,
277
+
"name": "<value>",
278
+
"client_id": "<id>",
279
+
"client_secret": "<value>",
280
+
})
281
+
282
+
assert res isnotNone
283
+
284
+
# Handle response
285
+
print(res)
286
+
287
+
asyncio.run(main())
288
+
```
289
+
290
+
### Example 4
291
+
292
+
```python
293
+
# Synchronous Example
294
+
import ragie
295
+
from ragie import Ragie
296
+
297
+
298
+
with Ragie(
299
+
auth="<YOUR_BEARER_TOKEN_HERE>",
300
+
) as r_client:
301
+
302
+
res = r_client.authenticators.create_authenticator_connection(authenticator_id="84b0792c-1330-4854-b4f2-5d9c7bf9a385", create_authenticator_connection=ragie.CreateAuthenticatorConnection(
The same SDK client can also be used to make asychronous requests by importing asyncio.
327
+
```python
328
+
# Asynchronous Example
329
+
import asyncio
330
+
import ragie
331
+
from ragie import Ragie
332
+
333
+
asyncdefmain():
334
+
335
+
asyncwith Ragie(
336
+
auth="<YOUR_BEARER_TOKEN_HERE>",
337
+
) as r_client:
338
+
339
+
res =await r_client.authenticators.create_authenticator_connection_async(authenticator_id="84b0792c-1330-4854-b4f2-5d9c7bf9a385", create_authenticator_connection=ragie.CreateAuthenticatorConnection(
|`.raw_response`|*httpx.Response*| The raw HTTP response |
358
-
|`.body`|*str*| The response content |
359
-
360
-
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_async` method may raise the following exceptions:
556
+
[`RagieError`](https://github.com/ragieai/ragie-python/blob/master/./src/ragie/models/ragieerror.py) is the base class for all HTTP error responses. It has the following properties:
**Inherit from [`RagieError`](https://github.com/ragieai/ragie-python/blob/master/./src/ragie/models/ragieerror.py)**:
622
+
*[`ResponseValidationError`](https://github.com/ragieai/ragie-python/blob/master/./src/ragie/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
623
+
624
+
</details>
625
+
626
+
\* Check [the method documentation](https://github.com/ragieai/ragie-python/blob/master/#available-resources-and-operations) to see if the error is applicable.
0 commit comments