Skip to content

Commit e3d14f6

Browse files
authored
Merge pull request #138 from dubinc/speakeasy-sdk-regen-1751762072
chore: 🐝 Update SDK - Generate 0.27.0
2 parents 9496871 + 51a3602 commit e3d14f6

Some content is hidden

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

45 files changed

+3258
-3477
lines changed

β€Ž.speakeasy/gen.lockβ€Ž

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
lockVersion: 2.0.0
22
id: ab657d60-207e-43a4-8cc8-692a672950ed
33
management:
4-
docChecksum: 9cde19fee10d246922e255635d90eec7
4+
docChecksum: 6e45f3521cae083a495cc5102bf01725
55
docVersion: 0.0.1
6-
speakeasyVersion: 1.573.0
7-
generationVersion: 2.644.1
8-
releaseVersion: 0.26.12
9-
configChecksum: 6d4f0378a532891ca0223c42c66380ef
6+
speakeasyVersion: 1.576.1
7+
generationVersion: 2.651.2
8+
releaseVersion: 0.27.0
9+
configChecksum: 92441ba18ee67373019981a25171b2d0
1010
repoURL: https://github.com/dubinc/dub-python.git
1111
installationURL: https://github.com/dubinc/dub-python.git
1212
published: true
1313
features:
1414
python:
1515
additionalDependencies: 1.0.0
1616
constsAndDefaults: 1.0.5
17-
core: 5.19.3
17+
core: 5.19.4
1818
defaultEnabledRetries: 0.2.0
1919
deprecations: 3.0.2
2020
enumUnions: 0.1.0
2121
envVarSecurityUsage: 0.3.2
22-
errors: 3.2.0
22+
errors: 3.3.0
2323
examples: 3.0.1
2424
flattening: 3.1.1
2525
globalSecurity: 3.0.3
@@ -428,11 +428,14 @@ generatedFiles:
428428
- src/dub/models/errors/__init__.py
429429
- src/dub/models/errors/badrequest.py
430430
- src/dub/models/errors/conflict.py
431+
- src/dub/models/errors/duberror.py
431432
- src/dub/models/errors/forbidden.py
432433
- src/dub/models/errors/internalservererror.py
433434
- src/dub/models/errors/inviteexpired.py
435+
- src/dub/models/errors/no_response_error.py
434436
- src/dub/models/errors/notfound.py
435437
- src/dub/models/errors/ratelimitexceeded.py
438+
- src/dub/models/errors/responsevalidationerror.py
436439
- src/dub/models/errors/sdkerror.py
437440
- src/dub/models/errors/unauthorized.py
438441
- src/dub/models/errors/unprocessableentity.py

β€Ž.speakeasy/gen.yamlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ generation:
2121
generateNewTests: false
2222
skipResponseBodyAssertions: false
2323
python:
24-
version: 0.26.12
24+
version: 0.27.0
2525
additionalDependencies:
2626
dev: {}
2727
main: {}

β€Ž.speakeasy/workflow.lockβ€Ž

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.573.0
1+
speakeasyVersion: 1.576.1
22
sources:
33
dub:
44
sourceNamespace: dub
5-
sourceRevisionDigest: sha256:2adc553d91c800d33e296aa71e63a69112f76e01ac3106df34faf94771d85a0f
6-
sourceBlobDigest: sha256:4c8d64728220fa2132c4e6ee78cd5498ff27ac5ef8804dccd2d6c4cd99b731ff
5+
sourceRevisionDigest: sha256:e9e0d1760d0eb0cd1abb719951767ff56aae15d12fed72809614a0cc80f18a03
6+
sourceBlobDigest: sha256:2ec795073bdfba6e77310200e44ac26ab5352ab03a9ecc192b619d8949212d91
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1750811469
9+
- speakeasy-sdk-regen-1751762072
1010
- 0.0.1
1111
targets:
1212
my-first-target:
1313
source: dub
1414
sourceNamespace: dub
15-
sourceRevisionDigest: sha256:2adc553d91c800d33e296aa71e63a69112f76e01ac3106df34faf94771d85a0f
16-
sourceBlobDigest: sha256:4c8d64728220fa2132c4e6ee78cd5498ff27ac5ef8804dccd2d6c4cd99b731ff
15+
sourceRevisionDigest: sha256:e9e0d1760d0eb0cd1abb719951767ff56aae15d12fed72809614a0cc80f18a03
16+
sourceBlobDigest: sha256:2ec795073bdfba6e77310200e44ac26ab5352ab03a9ecc192b619d8949212d91
1717
codeSamplesNamespace: code-samples-python-my-first-target
18-
codeSamplesRevisionDigest: sha256:5696171253056a1ddb4c062a69c0b053cf55fdc240c7f536c273e635150779e3
18+
codeSamplesRevisionDigest: sha256:a0ecc149387f36809c3181c0aa8dde14dbfee9a8a0c62c657378b196029463e5
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

β€ŽREADME.mdβ€Ž

Lines changed: 50 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -345,34 +345,18 @@ asyncio.run(main())
345345
<!-- Start Error Handling [errors] -->
346346
## Error Handling
347347

348-
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
349-
350-
By default, an API error will raise a errors.SDKError exception, which has the following properties:
351-
352-
| Property | Type | Description |
353-
|-----------------|------------------|-----------------------|
354-
| `.status_code` | *int* | The HTTP status code |
355-
| `.message` | *str* | The error message |
356-
| `.raw_response` | *httpx.Response* | The raw HTTP response |
357-
| `.body` | *str* | The response content |
358-
359-
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:
360-
361-
| Error Type | Status Code | Content Type |
362-
| -------------------------- | ----------- | ---------------- |
363-
| errors.BadRequest | 400 | application/json |
364-
| errors.Unauthorized | 401 | application/json |
365-
| errors.Forbidden | 403 | application/json |
366-
| errors.NotFound | 404 | application/json |
367-
| errors.Conflict | 409 | application/json |
368-
| errors.InviteExpired | 410 | application/json |
369-
| errors.UnprocessableEntity | 422 | application/json |
370-
| errors.RateLimitExceeded | 429 | application/json |
371-
| errors.InternalServerError | 500 | application/json |
372-
| errors.SDKError | 4XX, 5XX | \*/\* |
348+
[`DubError`](./src/dub/models/errors/duberror.py) is the base class for all HTTP error responses. It has the following properties:
373349

374-
### Example
350+
| Property | Type | Description |
351+
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
352+
| `err.message` | `str` | Error message |
353+
| `err.status_code` | `int` | HTTP response status code eg `404` |
354+
| `err.headers` | `httpx.Headers` | HTTP response headers |
355+
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
356+
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
357+
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
375358

359+
### Example
376360
```python
377361
from dub import Dub
378362
from dub.models import errors
@@ -407,37 +391,47 @@ with Dub(
407391
# Handle response
408392
print(res)
409393

410-
except errors.BadRequest as e:
411-
# handle e.data: errors.BadRequestData
412-
raise(e)
413-
except errors.Unauthorized as e:
414-
# handle e.data: errors.UnauthorizedData
415-
raise(e)
416-
except errors.Forbidden as e:
417-
# handle e.data: errors.ForbiddenData
418-
raise(e)
419-
except errors.NotFound as e:
420-
# handle e.data: errors.NotFoundData
421-
raise(e)
422-
except errors.Conflict as e:
423-
# handle e.data: errors.ConflictData
424-
raise(e)
425-
except errors.InviteExpired as e:
426-
# handle e.data: errors.InviteExpiredData
427-
raise(e)
428-
except errors.UnprocessableEntity as e:
429-
# handle e.data: errors.UnprocessableEntityData
430-
raise(e)
431-
except errors.RateLimitExceeded as e:
432-
# handle e.data: errors.RateLimitExceededData
433-
raise(e)
434-
except errors.InternalServerError as e:
435-
# handle e.data: errors.InternalServerErrorData
436-
raise(e)
437-
except errors.SDKError as e:
438-
# handle exception
439-
raise(e)
394+
395+
except errors.DubError as e:
396+
# The base class for HTTP error responses
397+
print(e.message)
398+
print(e.status_code)
399+
print(e.body)
400+
print(e.headers)
401+
print(e.raw_response)
402+
403+
# Depending on the method different errors may be thrown
404+
if isinstance(e, errors.BadRequest):
405+
print(e.data.error) # errors.Error
440406
```
407+
408+
### Error Classes
409+
**Primary errors:**
410+
* [`DubError`](./src/dub/models/errors/duberror.py): The base class for HTTP error responses.
411+
* [`BadRequest`](./src/dub/models/errors/badrequest.py): The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). Status code `400`.
412+
* [`Unauthorized`](./src/dub/models/errors/unauthorized.py): Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. Status code `401`.
413+
* [`Forbidden`](./src/dub/models/errors/forbidden.py): The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. Status code `403`.
414+
* [`NotFound`](./src/dub/models/errors/notfound.py): The server cannot find the requested resource. Status code `404`.
415+
* [`Conflict`](./src/dub/models/errors/conflict.py): This response is sent when a request conflicts with the current state of the server. Status code `409`.
416+
* [`InviteExpired`](./src/dub/models/errors/inviteexpired.py): This response is sent when the requested content has been permanently deleted from server, with no forwarding address. Status code `410`.
417+
* [`UnprocessableEntity`](./src/dub/models/errors/unprocessableentity.py): The request was well-formed but was unable to be followed due to semantic errors. Status code `422`.
418+
* [`RateLimitExceeded`](./src/dub/models/errors/ratelimitexceeded.py): The user has sent too many requests in a given amount of time ("rate limiting"). Status code `429`.
419+
* [`InternalServerError`](./src/dub/models/errors/internalservererror.py): The server has encountered a situation it does not know how to handle. Status code `500`.
420+
421+
<details><summary>Less common errors (5)</summary>
422+
423+
<br />
424+
425+
**Network errors:**
426+
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
427+
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
428+
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
429+
430+
431+
**Inherit from [`DubError`](./src/dub/models/errors/duberror.py)**:
432+
* [`ResponseValidationError`](./src/dub/models/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
433+
434+
</details>
441435
<!-- End Error Handling [errors] -->
442436

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

β€ŽRELEASES.mdβ€Ž

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,4 +1286,14 @@ Based on:
12861286
### Generated
12871287
- [python v0.26.12] .
12881288
### Releases
1289-
- [PyPI v0.26.12] https://pypi.org/project/dub/0.26.12 - .
1289+
- [PyPI v0.26.12] https://pypi.org/project/dub/0.26.12 - .
1290+
1291+
## 2025-07-08 00:30:47
1292+
### Changes
1293+
Based on:
1294+
- OpenAPI Doc
1295+
- Speakeasy CLI 1.576.1 (2.651.2) https://github.com/speakeasy-api/speakeasy
1296+
### Generated
1297+
- [python v0.27.0] .
1298+
### Releases
1299+
- [PyPI v0.27.0] https://pypi.org/project/dub/0.27.0 - .

β€Ždocs/models/operations/createcustomerdiscount.mdβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
1313
| `coupon_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
1414
| `coupon_test_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
15-
| `partners_count` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
15+
| `partners_count` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
16+
| `default` | *bool* | :heavy_check_mark: | N/A |

β€Ždocs/models/operations/discount.mdβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
1313
| `coupon_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
1414
| `coupon_test_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
15-
| `partners_count` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
15+
| `partners_count` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
16+
| `default` | *bool* | :heavy_check_mark: | N/A |

β€Ždocs/models/operations/getcustomerdiscount.mdβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
1313
| `coupon_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
1414
| `coupon_test_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
15-
| `partners_count` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
15+
| `partners_count` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
16+
| `default` | *bool* | :heavy_check_mark: | N/A |

β€Ždocs/models/operations/updatecustomerdiscount.mdβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
1313
| `coupon_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
1414
| `coupon_test_id` | *Nullable[str]* | :heavy_check_mark: | N/A |
15-
| `partners_count` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
15+
| `partners_count` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
16+
| `default` | *bool* | :heavy_check_mark: | N/A |

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "dub"
3-
version = "0.26.12"
3+
version = "0.27.0"
44
description = "Python Client SDK Generated by Speakeasy"
55
authors = [{ name = "Speakeasy" },]
66
readme = "README-PYPI.md"

0 commit comments

Comments
Β (0)