Skip to content

Commit a26d0cd

Browse files
authored
Merge pull request #34 from ragieai/speakeasy-sdk-regen-1752806269
chore: 🐝 Update SDK - Generate 1.10.0
2 parents 9f96f44 + 4269258 commit a26d0cd

File tree

184 files changed

+7274
-2291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+7274
-2291
lines changed

.speakeasy/gen.lock

Lines changed: 193 additions & 18 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ generation:
77
maintainOpenAPIOrder: true
88
usageSnippets:
99
optionalPropertyRendering: withExample
10+
sdkInitStyle: constructor
1011
useClassNamesForArrayFields: true
1112
fixes:
1213
nameResolutionDec2023: true
@@ -18,13 +19,18 @@ generation:
1819
auth:
1920
oAuth2ClientCredentialsEnabled: false
2021
oAuth2PasswordEnabled: false
22+
tests:
23+
generateTests: true
24+
generateNewTests: false
25+
skipResponseBodyAssertions: false
2126
python:
22-
version: 1.9.0
27+
version: 1.10.0
2328
additionalDependencies:
2429
dev: {}
2530
main: {}
2631
authors:
2732
- Speakeasy
33+
baseErrorName: RagieError
2834
clientServerStatusCodesAsErrors: true
2935
defaultErrorName: SDKError
3036
description: Python Client SDK Generated by Speakeasy.

.speakeasy/workflow.lock

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
speakeasyVersion: 1.546.1
1+
speakeasyVersion: 1.583.0
22
sources:
33
Ragie-OAS:
44
sourceNamespace: ragie-oas
5-
sourceRevisionDigest: sha256:8f8d8211fac3e8e963eaa25ab0bbee3967324027a69bb64355a08248156076a0
6-
sourceBlobDigest: sha256:fe68f5434abcfad6ee42c75a174de0c68a315c9085c972e996f3791ec0940d17
5+
sourceRevisionDigest: sha256:8715c0715db871d16c04ff625d360931b868c61f56dc3b30193593777a9c39fb
6+
sourceBlobDigest: sha256:c2c01e41f1f411c94684057892927815bba9e45f7def34173ff5027b5c8f5133
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1745626047
9+
- speakeasy-sdk-regen-1752806269
1010
- 1.0.0
1111
targets:
1212
ragie:
1313
source: Ragie-OAS
1414
sourceNamespace: ragie-oas
15-
sourceRevisionDigest: sha256:8f8d8211fac3e8e963eaa25ab0bbee3967324027a69bb64355a08248156076a0
16-
sourceBlobDigest: sha256:fe68f5434abcfad6ee42c75a174de0c68a315c9085c972e996f3791ec0940d17
15+
sourceRevisionDigest: sha256:8715c0715db871d16c04ff625d360931b868c61f56dc3b30193593777a9c39fb
16+
sourceBlobDigest: sha256:c2c01e41f1f411c94684057892927815bba9e45f7def34173ff5027b5c8f5133
1717
codeSamplesNamespace: ragie-oas-python-code-samples
18-
codeSamplesRevisionDigest: sha256:80c686b1c222974b9042938c41c807402e911425de2c1f7785ea9586825d07d8
18+
codeSamplesRevisionDigest: sha256:744a7e61f36bba2c1e3670d6c9e7aa508d399d865eadc0bedc277cf135d4ff42
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest
2222
sources:
2323
Ragie-OAS:
2424
inputs:
2525
- location: https://api.ragie.ai/openapi.json
26+
overlays:
27+
- location: .speakeasy/remove-webhooks.overlay.yaml
2628
registry:
2729
location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-oas
2830
targets:

README-PYPI.md

Lines changed: 253 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
108108
<!-- Start SDK Example Usage [usage] -->
109109
## SDK Example Usage
110110

111-
### Example
111+
### Example 1
112112

113113
```python
114114
# Synchronous Example
@@ -158,6 +158,205 @@ async def main():
158158
# Handle response
159159
print(res)
160160

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 is not None
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+
async def main():
207+
208+
async with 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 is not None
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 is not None
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+
async def main():
270+
271+
async with 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 is not None
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(
303+
partition_strategy=ragie.MediaModeParam(),
304+
page_limit=None,
305+
config=None,
306+
connection=ragie.AuthenticatorDropboxConnection(
307+
data=ragie.FolderData(
308+
folder_id="<id>",
309+
folder_name="<value>",
310+
),
311+
312+
credentials=ragie.OAuthRefreshTokenCredentials(
313+
refresh_token="<value>",
314+
),
315+
),
316+
))
317+
318+
assert res is not None
319+
320+
# Handle response
321+
print(res)
322+
```
323+
324+
</br>
325+
326+
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+
async def main():
334+
335+
async with 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(
340+
partition_strategy=ragie.MediaModeParam(),
341+
page_limit=None,
342+
config=None,
343+
connection=ragie.AuthenticatorDropboxConnection(
344+
data=ragie.FolderData(
345+
folder_id="<id>",
346+
folder_name="<value>",
347+
),
348+
349+
credentials=ragie.OAuthRefreshTokenCredentials(
350+
refresh_token="<value>",
351+
),
352+
),
353+
))
354+
355+
assert res is not None
356+
357+
# Handle response
358+
print(res)
359+
161360
asyncio.run(main())
162361
```
163362
<!-- End SDK Example Usage [usage] -->
@@ -168,8 +367,16 @@ asyncio.run(main())
168367
<details open>
169368
<summary>Available methods</summary>
170369

370+
### [authenticators](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/authenticators/README.md)
371+
372+
* [create](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/authenticators/README.md#create) - Create Authenticator
373+
* [list](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/authenticators/README.md#list) - List Authenticators
374+
* [create_authenticator_connection](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/authenticators/README.md#create_authenticator_connection) - Create Authenticator Connection
375+
* [delete_authenticator_connection](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/authenticators/README.md#delete_authenticator_connection) - Delete Authenticator
376+
171377
### [connections](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/connections/README.md)
172378

379+
* [create_connection](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/connections/README.md#create_connection) - Create Connection
173380
* [list](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/connections/README.md#list) - List Connections
174381
* [create_o_auth_redirect_url](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/connections/README.md#create_o_auth_redirect_url) - Create Oauth Redirect Url
175382
* [list_connection_source_types](https://github.com/ragieai/ragie-python/blob/master/docs/sdks/connections/README.md#list_connection_source_types) - List Connection Source Types
@@ -346,28 +553,20 @@ with Ragie(
346553
<!-- Start Error Handling [errors] -->
347554
## Error Handling
348555

349-
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
350-
351-
By default, an API error will raise a models.SDKError exception, which has the following properties:
352-
353-
| Property | Type | Description |
354-
|-----------------|------------------|-----------------------|
355-
| `.status_code` | *int* | The HTTP status code |
356-
| `.message` | *str* | The error message |
357-
| `.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:
361557

362-
| Error Type | Status Code | Content Type |
363-
| -------------------------- | ------------------ | ---------------- |
364-
| models.HTTPValidationError | 422 | application/json |
365-
| models.ErrorMessage | 400, 401, 402, 429 | application/json |
366-
| models.SDKError | 4XX, 5XX | \*/\* |
558+
| Property | Type | Description |
559+
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
560+
| `err.message` | `str` | Error message |
561+
| `err.status_code` | `int` | HTTP response status code eg `404` |
562+
| `err.headers` | `httpx.Headers` | HTTP response headers |
563+
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
564+
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
565+
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/ragieai/ragie-python/blob/master/#error-classes). |
367566

368567
### Example
369-
370568
```python
569+
import ragie
371570
from ragie import Ragie, models
372571

373572

@@ -389,16 +588,42 @@ with Ragie(
389588
# Handle response
390589
print(res)
391590

392-
except models.HTTPValidationError as e:
393-
# handle e.data: models.HTTPValidationErrorData
394-
raise(e)
395-
except models.ErrorMessage as e:
396-
# handle e.data: models.ErrorMessageData
397-
raise(e)
398-
except models.SDKError as e:
399-
# handle exception
400-
raise(e)
591+
592+
except models.RagieError as e:
593+
# The base class for HTTP error responses
594+
print(e.message)
595+
print(e.status_code)
596+
print(e.body)
597+
print(e.headers)
598+
print(e.raw_response)
599+
600+
# Depending on the method different errors may be thrown
601+
if isinstance(e, models.HTTPValidationError):
602+
print(e.data.detail) # Optional[List[ragie.ValidationError]]
401603
```
604+
605+
### Error Classes
606+
**Primary errors:**
607+
* [`RagieError`](https://github.com/ragieai/ragie-python/blob/master/./src/ragie/models/ragieerror.py): The base class for HTTP error responses.
608+
* [`ErrorMessage`](https://github.com/ragieai/ragie-python/blob/master/./src/ragie/models/errormessage.py): Unauthorized.
609+
* [`HTTPValidationError`](https://github.com/ragieai/ragie-python/blob/master/./src/ragie/models/httpvalidationerror.py): Validation Error. Status code `422`. *
610+
611+
<details><summary>Less common errors (5)</summary>
612+
613+
<br />
614+
615+
**Network errors:**
616+
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
617+
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
618+
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
619+
620+
621+
**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.
402627
<!-- End Error Handling [errors] -->
403628

404629
<!-- Start Server Selection [server] -->

0 commit comments

Comments
 (0)