Skip to content

Commit

Permalink
release(sdk): v2.0.0-beta.10
Browse files Browse the repository at this point in the history
  • Loading branch information
NumaryBot committed Jan 18, 2024
1 parent ad64b45 commit 900bf50
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
lockVersion: 2.0.0
id: 48d9323f-a658-4e97-b179-9d7dd16d109c
id: 279c91d4-df40-4e5a-9dff-3f12a0bcdaac
management:
docChecksum: 19f45ae5d8990dc505885da49871ae14
docVersion: v2.0.0-beta.9
docChecksum: bf3929cd2ca1ce376006df43bc2705f2
docVersion: v2.0.0-beta.10
speakeasyVersion: internal
generationVersion: 2.230.1
releaseVersion: v2.0.0-beta.9
configChecksum: 5cf44a2363d6197607824355f2092fa4
generationVersion: 2.234.1
releaseVersion: v2.0.0-beta.10
configChecksum: edb8f171cc163bbc58373c7bedad5b99
features:
python:
constsAndDefaults: 0.1.2
core: 4.4.1
core: 4.4.2
deprecations: 2.81.1
errors: 2.81.8
getRequestBodies: 2.81.1
Expand Down
1 change: 1 addition & 0 deletions docs/models/shared/configuser.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
| `endpoint` | *str* | :heavy_check_mark: | N/A | https://example.com |
| `event_types` | List[*str*] | :heavy_check_mark: | N/A | ["TYPE1","TYPE2"] |
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | customer_payment |
| `secret` | *Optional[str]* | :heavy_minus_sign: | N/A | V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3 |
1 change: 1 addition & 0 deletions docs/sdks/webhooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ req = shared.ConfigUser(
'TYPE1',
'TYPE2',
],
name='customer_payment',
secret='V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3',
)

Expand Down
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ generation:
comments: {}
telemetryEnabled: false
python:
version: v2.0.0-beta.9
version: v2.0.0-beta.10
author: Formance
clientServerStatusCodesAsErrors: true
description: Python Client SDK Generated by Speakeasy
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="formance-sdk-python",
version="v2.0.0-beta.9",
version="v2.0.0-beta.10",
author="Formance",
description="Python Client SDK Generated by Speakeasy",
long_description=long_description,
Expand Down
1 change: 1 addition & 0 deletions src/sdk/models/shared/configuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class ConfigUser:
endpoint: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('endpoint') }})
event_types: List[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('eventTypes') }})
name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }})
secret: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('secret'), 'exclude': lambda f: f is None }})


12 changes: 8 additions & 4 deletions src/sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .webhooks import Webhooks
from sdk import utils
from sdk.models import errors, operations, shared
from typing import Dict, Optional
from typing import Callable, Dict, Optional, Union

class SDK:
r"""Formance Stack API: Open, modular foundation for unique payments flows
Expand All @@ -39,7 +39,7 @@ class SDK:
sdk_configuration: SDKConfiguration

def __init__(self,
authorization: str ,
authorization: Union[str, Callable[[], str]],
server_idx: int = None,
server_url: str = None,
url_params: Dict[str, str] = None,
Expand All @@ -49,7 +49,7 @@ def __init__(self,
"""Instantiates the SDK configuring it with the provided parameters.
:param authorization: The authorization required for authentication
:type authorization: Union[str,Callable[[], str]]
:type authorization: Union[str, Callable[[], str]]
:param server_idx: The index of the server to use for all operations
:type server_idx: int
:param server_url: The server URL to use for all operations
Expand All @@ -64,7 +64,11 @@ def __init__(self,
if client is None:
client = requests_http.Session()

security = shared.Security(authorization = authorization)
if callable(authorization):
def security():
return shared.Security(authorization = authorization())
else:
security = shared.Security(authorization = authorization)

if server_url is not None:
if url_params is not None:
Expand Down
8 changes: 4 additions & 4 deletions src/sdk/sdkconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class SDKConfiguration:
server_url: str = ''
server_idx: int = 0
language: str = 'python'
openapi_doc_version: str = 'v2.0.0-beta.9'
sdk_version: str = 'v2.0.0-beta.9'
gen_version: str = '2.230.1'
user_agent: str = 'speakeasy-sdk/python v2.0.0-beta.9 2.230.1 v2.0.0-beta.9 formance-sdk-python'
openapi_doc_version: str = 'v2.0.0-beta.10'
sdk_version: str = 'v2.0.0-beta.10'
gen_version: str = '2.234.1'
user_agent: str = 'speakeasy-sdk/python v2.0.0-beta.10 2.234.1 v2.0.0-beta.10 formance-sdk-python'
retry_config: RetryConfig = None

def get_server_details(self) -> Tuple[str, Dict[str, str]]:
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/utils/retries.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ def do_request():
if res.status_code == parsed_code:
raise TemporaryError(res)
except requests.exceptions.ConnectionError as exception:
if not retries.config.config.retry_connection_errors:
if retries.config.config.retry_connection_errors:
raise

raise PermanentError(exception) from exception
except requests.exceptions.Timeout as exception:
if not retries.config.config.retry_connection_errors:
if retries.config.config.retry_connection_errors:
raise

raise PermanentError(exception) from exception
Expand Down

0 comments on commit 900bf50

Please sign in to comment.