Skip to content

Commit 900bf50

Browse files
author
NumaryBot
committed
release(sdk): v2.0.0-beta.10
1 parent ad64b45 commit 900bf50

File tree

9 files changed

+26
-19
lines changed

9 files changed

+26
-19
lines changed

.speakeasy/gen.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
lockVersion: 2.0.0
2-
id: 48d9323f-a658-4e97-b179-9d7dd16d109c
2+
id: 279c91d4-df40-4e5a-9dff-3f12a0bcdaac
33
management:
4-
docChecksum: 19f45ae5d8990dc505885da49871ae14
5-
docVersion: v2.0.0-beta.9
4+
docChecksum: bf3929cd2ca1ce376006df43bc2705f2
5+
docVersion: v2.0.0-beta.10
66
speakeasyVersion: internal
7-
generationVersion: 2.230.1
8-
releaseVersion: v2.0.0-beta.9
9-
configChecksum: 5cf44a2363d6197607824355f2092fa4
7+
generationVersion: 2.234.1
8+
releaseVersion: v2.0.0-beta.10
9+
configChecksum: edb8f171cc163bbc58373c7bedad5b99
1010
features:
1111
python:
1212
constsAndDefaults: 0.1.2
13-
core: 4.4.1
13+
core: 4.4.2
1414
deprecations: 2.81.1
1515
errors: 2.81.8
1616
getRequestBodies: 2.81.1

docs/models/shared/configuser.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
88
| `endpoint` | *str* | :heavy_check_mark: | N/A | https://example.com |
99
| `event_types` | List[*str*] | :heavy_check_mark: | N/A | ["TYPE1","TYPE2"] |
10+
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | customer_payment |
1011
| `secret` | *Optional[str]* | :heavy_minus_sign: | N/A | V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3 |

docs/sdks/webhooks/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ req = shared.ConfigUser(
256256
'TYPE1',
257257
'TYPE2',
258258
],
259+
name='customer_payment',
259260
secret='V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3',
260261
)
261262

gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ generation:
88
comments: {}
99
telemetryEnabled: false
1010
python:
11-
version: v2.0.0-beta.9
11+
version: v2.0.0-beta.10
1212
author: Formance
1313
clientServerStatusCodesAsErrors: true
1414
description: Python Client SDK Generated by Speakeasy

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name="formance-sdk-python",
13-
version="v2.0.0-beta.9",
13+
version="v2.0.0-beta.10",
1414
author="Formance",
1515
description="Python Client SDK Generated by Speakeasy",
1616
long_description=long_description,

src/sdk/models/shared/configuser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class ConfigUser:
1313
endpoint: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('endpoint') }})
1414
event_types: List[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('eventTypes') }})
15+
name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }})
1516
secret: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('secret'), 'exclude': lambda f: f is None }})
1617

1718

src/sdk/sdk.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .webhooks import Webhooks
1313
from sdk import utils
1414
from sdk.models import errors, operations, shared
15-
from typing import Dict, Optional
15+
from typing import Callable, Dict, Optional, Union
1616

1717
class SDK:
1818
r"""Formance Stack API: Open, modular foundation for unique payments flows
@@ -39,7 +39,7 @@ class SDK:
3939
sdk_configuration: SDKConfiguration
4040

4141
def __init__(self,
42-
authorization: str ,
42+
authorization: Union[str, Callable[[], str]],
4343
server_idx: int = None,
4444
server_url: str = None,
4545
url_params: Dict[str, str] = None,
@@ -49,7 +49,7 @@ def __init__(self,
4949
"""Instantiates the SDK configuring it with the provided parameters.
5050
5151
:param authorization: The authorization required for authentication
52-
:type authorization: Union[str,Callable[[], str]]
52+
:type authorization: Union[str, Callable[[], str]]
5353
:param server_idx: The index of the server to use for all operations
5454
:type server_idx: int
5555
:param server_url: The server URL to use for all operations
@@ -64,7 +64,11 @@ def __init__(self,
6464
if client is None:
6565
client = requests_http.Session()
6666

67-
security = shared.Security(authorization = authorization)
67+
if callable(authorization):
68+
def security():
69+
return shared.Security(authorization = authorization())
70+
else:
71+
security = shared.Security(authorization = authorization)
6872

6973
if server_url is not None:
7074
if url_params is not None:

src/sdk/sdkconfiguration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class SDKConfiguration:
2121
server_url: str = ''
2222
server_idx: int = 0
2323
language: str = 'python'
24-
openapi_doc_version: str = 'v2.0.0-beta.9'
25-
sdk_version: str = 'v2.0.0-beta.9'
26-
gen_version: str = '2.230.1'
27-
user_agent: str = 'speakeasy-sdk/python v2.0.0-beta.9 2.230.1 v2.0.0-beta.9 formance-sdk-python'
24+
openapi_doc_version: str = 'v2.0.0-beta.10'
25+
sdk_version: str = 'v2.0.0-beta.10'
26+
gen_version: str = '2.234.1'
27+
user_agent: str = 'speakeasy-sdk/python v2.0.0-beta.10 2.234.1 v2.0.0-beta.10 formance-sdk-python'
2828
retry_config: RetryConfig = None
2929

3030
def get_server_details(self) -> Tuple[str, Dict[str, str]]:

src/sdk/utils/retries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ def do_request():
7575
if res.status_code == parsed_code:
7676
raise TemporaryError(res)
7777
except requests.exceptions.ConnectionError as exception:
78-
if not retries.config.config.retry_connection_errors:
78+
if retries.config.config.retry_connection_errors:
7979
raise
8080

8181
raise PermanentError(exception) from exception
8282
except requests.exceptions.Timeout as exception:
83-
if not retries.config.config.retry_connection_errors:
83+
if retries.config.config.retry_connection_errors:
8484
raise
8585

8686
raise PermanentError(exception) from exception

0 commit comments

Comments
 (0)