Skip to content

Commit 2fc9f17

Browse files
authored
Merge pull request #125 from dubinc/speakeasy-sdk-regen-1748565018
chore: 🐝 Update SDK - Generate 0.26.0
2 parents 8ea8524 + f265e42 commit 2fc9f17

24 files changed

Lines changed: 145 additions & 57 deletions

.speakeasy/gen.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ id: ab657d60-207e-43a4-8cc8-692a672950ed
33
management:
44
docChecksum: a2ac297972706e86f31e833913025851
55
docVersion: 0.0.1
6-
speakeasyVersion: 1.552.0
7-
generationVersion: 2.610.0
8-
releaseVersion: 0.25.0
9-
configChecksum: 7a6ee815c6c45dd92618edffea36d91e
6+
speakeasyVersion: 1.554.1
7+
generationVersion: 2.616.1
8+
releaseVersion: 0.26.0
9+
configChecksum: af21bfd609992bfb91e5860e5da568d7
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.0
17+
core: 5.19.1
1818
defaultEnabledRetries: 0.2.0
1919
deprecations: 3.0.2
2020
enumUnions: 0.1.0
@@ -32,7 +32,7 @@ features:
3232
pagination: 3.0.5
3333
responseFormat: 1.0.1
3434
retries: 3.0.2
35-
sdkHooks: 1.0.1
35+
sdkHooks: 1.1.0
3636
unions: 3.0.4
3737
generatedFiles:
3838
- .gitattributes

.speakeasy/gen.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ generation:
44
maintainOpenAPIOrder: true
55
usageSnippets:
66
optionalPropertyRendering: withExample
7+
sdkInitStyle: constructor
78
useClassNamesForArrayFields: true
89
fixes:
910
nameResolutionDec2023: true
@@ -16,7 +17,7 @@ generation:
1617
oAuth2ClientCredentialsEnabled: true
1718
oAuth2PasswordEnabled: false
1819
python:
19-
version: 0.25.0
20+
version: 0.26.0
2021
additionalDependencies:
2122
dev: {}
2223
main: {}

.speakeasy/workflow.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.552.0
1+
speakeasyVersion: 1.554.1
22
sources:
33
dub:
44
sourceNamespace: dub
5-
sourceRevisionDigest: sha256:2dc083ecf69ea3bd2bbd45bf97953f2c2797aa98d735a68a5ab3ef1f96fa058d
5+
sourceRevisionDigest: sha256:b4367b54ec8591545af8081441bf37f26bd1a057e5cc09a0e0509ebe28b09384
66
sourceBlobDigest: sha256:39e620a3019835bf60651aa58ed0d979c02eb2cefe4afaa897c28e7298c5da14
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1748478609
9+
- speakeasy-sdk-regen-1748565018
1010
- 0.0.1
1111
targets:
1212
my-first-target:
1313
source: dub
1414
sourceNamespace: dub
15-
sourceRevisionDigest: sha256:2dc083ecf69ea3bd2bbd45bf97953f2c2797aa98d735a68a5ab3ef1f96fa058d
15+
sourceRevisionDigest: sha256:b4367b54ec8591545af8081441bf37f26bd1a057e5cc09a0e0509ebe28b09384
1616
sourceBlobDigest: sha256:39e620a3019835bf60651aa58ed0d979c02eb2cefe4afaa897c28e7298c5da14
1717
codeSamplesNamespace: code-samples-python-my-first-target
18-
codeSamplesRevisionDigest: sha256:5cceff8cdac026f67d2d5fb7d54075d44c734332677e8c6606ced49f8277aaa3
18+
codeSamplesRevisionDigest: sha256:22c552a156f59fb1c51101e9022141519bb26e43eb128e3d404fe1a8233ab09f
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,4 +1156,14 @@ Based on:
11561156
### Generated
11571157
- [python v0.25.0] .
11581158
### Releases
1159-
- [PyPI v0.25.0] https://pypi.org/project/dub/0.25.0 - .
1159+
- [PyPI v0.25.0] https://pypi.org/project/dub/0.25.0 - .
1160+
1161+
## 2025-05-30 00:30:03
1162+
### Changes
1163+
Based on:
1164+
- OpenAPI Doc
1165+
- Speakeasy CLI 1.554.1 (2.616.1) https://github.com/speakeasy-api/speakeasy
1166+
### Generated
1167+
- [python v0.26.0] .
1168+
### Releases
1169+
- [PyPI v0.26.0] https://pypi.org/project/dub/0.26.0 - .

poetry.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[project]
22
name = "dub"
3-
version = "0.25.0"
3+
version = "0.26.0"
44
description = "Python Client SDK Generated by Speakeasy"
55
authors = [{ name = "Speakeasy" },]
66
readme = "README-PYPI.md"
77
requires-python = ">=3.9.2"
88
dependencies = [
9+
"httpcore >=1.0.9",
910
"httpx >=0.28.1",
1011
"jsonpath-python >=1.0.6",
1112
"pydantic >=2.11.2",

src/dub/_hooks/types.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22

33
from abc import ABC, abstractmethod
44
from dub.httpclient import HttpClient
5+
from dub.sdkconfiguration import SDKConfiguration
56
import httpx
67
from typing import Any, Callable, List, Optional, Tuple, Union
78

89

910
class HookContext:
11+
config: SDKConfiguration
1012
base_url: str
1113
operation_id: str
1214
oauth2_scopes: Optional[List[str]] = None
1315
security_source: Optional[Union[Any, Callable[[], Any]]] = None
1416

1517
def __init__(
1618
self,
19+
config: SDKConfiguration,
1720
base_url: str,
1821
operation_id: str,
1922
oauth2_scopes: Optional[List[str]],
2023
security_source: Optional[Union[Any, Callable[[], Any]]],
2124
):
25+
self.config = config
2226
self.base_url = base_url
2327
self.operation_id = operation_id
2428
self.oauth2_scopes = oauth2_scopes
@@ -28,6 +32,7 @@ def __init__(
2832
class BeforeRequestContext(HookContext):
2933
def __init__(self, hook_ctx: HookContext):
3034
super().__init__(
35+
hook_ctx.config,
3136
hook_ctx.base_url,
3237
hook_ctx.operation_id,
3338
hook_ctx.oauth2_scopes,
@@ -38,6 +43,7 @@ def __init__(self, hook_ctx: HookContext):
3843
class AfterSuccessContext(HookContext):
3944
def __init__(self, hook_ctx: HookContext):
4045
super().__init__(
46+
hook_ctx.config,
4147
hook_ctx.base_url,
4248
hook_ctx.operation_id,
4349
hook_ctx.oauth2_scopes,
@@ -48,6 +54,7 @@ def __init__(self, hook_ctx: HookContext):
4854
class AfterErrorContext(HookContext):
4955
def __init__(self, hook_ctx: HookContext):
5056
super().__init__(
57+
hook_ctx.config,
5158
hook_ctx.base_url,
5259
hook_ctx.operation_id,
5360
hook_ctx.oauth2_scopes,

src/dub/_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import importlib.metadata
44

55
__title__: str = "dub"
6-
__version__: str = "0.25.0"
6+
__version__: str = "0.26.0"
77
__openapi_doc_version__: str = "0.0.1"
8-
__gen_version__: str = "2.610.0"
9-
__user_agent__: str = "speakeasy-sdk/python 0.25.0 2.610.0 0.0.1 dub"
8+
__gen_version__: str = "2.616.1"
9+
__user_agent__: str = "speakeasy-sdk/python 0.26.0 2.616.1 0.0.1 dub"
1010

1111
try:
1212
if __package__ is not None:

src/dub/analytics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def retrieve(
7171

7272
http_res = self.do_request(
7373
hook_ctx=HookContext(
74+
config=self.sdk_configuration,
7475
base_url=base_url or "",
7576
operation_id="retrieveAnalytics",
7677
oauth2_scopes=[],
@@ -215,6 +216,7 @@ async def retrieve_async(
215216

216217
http_res = await self.do_request_async(
217218
hook_ctx=HookContext(
219+
config=self.sdk_configuration,
218220
base_url=base_url or "",
219221
operation_id="retrieveAnalytics",
220222
oauth2_scopes=[],

src/dub/basesdk.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ def do_request(
215215
client = self.sdk_configuration.client
216216
logger = self.sdk_configuration.debug_logger
217217

218+
hooks = self.sdk_configuration.__dict__["_hooks"]
219+
218220
def do():
219221
http_res = None
220222
try:
221-
req = self.sdk_configuration.get_hooks().before_request(
222-
BeforeRequestContext(hook_ctx), request
223-
)
223+
req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
224224
logger.debug(
225225
"Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
226226
req.method,
@@ -234,9 +234,7 @@ def do():
234234

235235
http_res = client.send(req, stream=stream)
236236
except Exception as e:
237-
_, e = self.sdk_configuration.get_hooks().after_error(
238-
AfterErrorContext(hook_ctx), None, e
239-
)
237+
_, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
240238
if e is not None:
241239
logger.debug("Request Exception", exc_info=True)
242240
raise e
@@ -254,7 +252,7 @@ def do():
254252
)
255253

256254
if utils.match_status_codes(error_status_codes, http_res.status_code):
257-
result, err = self.sdk_configuration.get_hooks().after_error(
255+
result, err = hooks.after_error(
258256
AfterErrorContext(hook_ctx), http_res, None
259257
)
260258
if err is not None:
@@ -274,9 +272,7 @@ def do():
274272
http_res = do()
275273

276274
if not utils.match_status_codes(error_status_codes, http_res.status_code):
277-
http_res = self.sdk_configuration.get_hooks().after_success(
278-
AfterSuccessContext(hook_ctx), http_res
279-
)
275+
http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
280276

281277
return http_res
282278

@@ -291,12 +287,12 @@ async def do_request_async(
291287
client = self.sdk_configuration.async_client
292288
logger = self.sdk_configuration.debug_logger
293289

290+
hooks = self.sdk_configuration.__dict__["_hooks"]
291+
294292
async def do():
295293
http_res = None
296294
try:
297-
req = self.sdk_configuration.get_hooks().before_request(
298-
BeforeRequestContext(hook_ctx), request
299-
)
295+
req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
300296
logger.debug(
301297
"Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
302298
req.method,
@@ -310,9 +306,7 @@ async def do():
310306

311307
http_res = await client.send(req, stream=stream)
312308
except Exception as e:
313-
_, e = self.sdk_configuration.get_hooks().after_error(
314-
AfterErrorContext(hook_ctx), None, e
315-
)
309+
_, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
316310
if e is not None:
317311
logger.debug("Request Exception", exc_info=True)
318312
raise e
@@ -330,7 +324,7 @@ async def do():
330324
)
331325

332326
if utils.match_status_codes(error_status_codes, http_res.status_code):
333-
result, err = self.sdk_configuration.get_hooks().after_error(
327+
result, err = hooks.after_error(
334328
AfterErrorContext(hook_ctx), http_res, None
335329
)
336330
if err is not None:
@@ -352,8 +346,6 @@ async def do():
352346
http_res = await do()
353347

354348
if not utils.match_status_codes(error_status_codes, http_res.status_code):
355-
http_res = self.sdk_configuration.get_hooks().after_success(
356-
AfterSuccessContext(hook_ctx), http_res
357-
)
349+
http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
358350

359351
return http_res

0 commit comments

Comments
 (0)