From 2838eb5415e46c0b8f3196906b74cafe2f22d3af Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 6 Apr 2023 00:01:23 +0000 Subject: [PATCH 1/4] ci: regenerated with OpenAPI Doc 2.1.0, Speakeay CLI 1.19.6 --- files/README.md | 6 ++-- files/RELEASES.md | 10 ++++++- files/USAGE.md | 6 ++-- files/files.gen | 28 +++++++++---------- files/gen.yaml | 8 +++--- files/setup.py | 2 +- files/src/{codat => codatfiles}/__init__.py | 0 files/src/{codat => codatfiles}/files.py | 2 +- .../{codat => codatfiles}/models/__init__.py | 0 .../models/operations/__init__.py | 0 .../models/operations/download_files.py | 0 .../models/operations/list_files.py | 0 .../models/operations/upload_files.py | 0 .../models/shared/__init__.py | 0 .../models/shared/file.py | 2 +- .../models/shared/security.py | 0 files/src/{codat => codatfiles}/sdk.py | 8 +++--- .../{codat => codatfiles}/utils/__init__.py | 0 .../{codat => codatfiles}/utils/retries.py | 0 .../src/{codat => codatfiles}/utils/utils.py | 0 20 files changed, 40 insertions(+), 32 deletions(-) rename files/src/{codat => codatfiles}/__init__.py (100%) rename files/src/{codat => codatfiles}/files.py (98%) rename files/src/{codat => codatfiles}/models/__init__.py (100%) rename files/src/{codat => codatfiles}/models/operations/__init__.py (100%) rename files/src/{codat => codatfiles}/models/operations/download_files.py (100%) rename files/src/{codat => codatfiles}/models/operations/list_files.py (100%) rename files/src/{codat => codatfiles}/models/operations/upload_files.py (100%) rename files/src/{codat => codatfiles}/models/shared/__init__.py (100%) rename files/src/{codat => codatfiles}/models/shared/file.py (98%) rename files/src/{codat => codatfiles}/models/shared/security.py (100%) rename files/src/{codat => codatfiles}/sdk.py (95%) rename files/src/{codat => codatfiles}/utils/__init__.py (100%) rename files/src/{codat => codatfiles}/utils/retries.py (100%) rename files/src/{codat => codatfiles}/utils/utils.py (100%) diff --git a/files/README.md b/files/README.md index 1fbbf2c88..16de8849d 100755 --- a/files/README.md +++ b/files/README.md @@ -13,10 +13,10 @@ pip install codat-files ## SDK Example Usage ```python -import codat -from codat.models import operations, shared +import codatfiles +from codatfiles.models import operations, shared -s = codat.Codat( +s = codatfiles.CodatFiles( security=shared.Security( auth_header="YOUR_API_KEY_HERE", ), diff --git a/files/RELEASES.md b/files/RELEASES.md index 3da371cd9..442e9e773 100644 --- a/files/RELEASES.md +++ b/files/RELEASES.md @@ -174,4 +174,12 @@ Based on: - OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml - Speakeasy CLI 1.19.3 (2.16.7) https://github.com/speakeasy-api/speakeasy ### Releases -- [PyPI v0.8.4] https://pypi.org/project/codat-files/0.8.4 - files \ No newline at end of file +- [PyPI v0.8.4] https://pypi.org/project/codat-files/0.8.4 - files + +## 2023-04-06 00:01:11 +### Changes +Based on: +- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml +- Speakeasy CLI 1.19.6 (2.17.8) https://github.com/speakeasy-api/speakeasy +### Releases +- [PyPI v0.9.0] https://pypi.org/project/codat-files/0.9.0 - files \ No newline at end of file diff --git a/files/USAGE.md b/files/USAGE.md index dee577b81..c55e79e2d 100755 --- a/files/USAGE.md +++ b/files/USAGE.md @@ -1,9 +1,9 @@ ```python -import codat -from codat.models import operations, shared +import codatfiles +from codatfiles.models import operations, shared -s = codat.Codat( +s = codatfiles.CodatFiles( security=shared.Security( auth_header="YOUR_API_KEY_HERE", ), diff --git a/files/files.gen b/files/files.gen index da72de9b0..72d0f49f6 100755 --- a/files/files.gen +++ b/files/files.gen @@ -1,17 +1,17 @@ -src/codat/files.py -src/codat/sdk.py +src/codatfiles/files.py +src/codatfiles/sdk.py pylintrc setup.py -src/codat/__init__.py -src/codat/models/__init__.py -src/codat/utils/__init__.py -src/codat/utils/retries.py -src/codat/utils/utils.py -src/codat/models/operations/download_files.py -src/codat/models/operations/list_files.py -src/codat/models/operations/upload_files.py -src/codat/models/operations/__init__.py -src/codat/models/shared/file.py -src/codat/models/shared/security.py -src/codat/models/shared/__init__.py +src/codatfiles/__init__.py +src/codatfiles/models/__init__.py +src/codatfiles/utils/__init__.py +src/codatfiles/utils/retries.py +src/codatfiles/utils/utils.py +src/codatfiles/models/operations/download_files.py +src/codatfiles/models/operations/list_files.py +src/codatfiles/models/operations/upload_files.py +src/codatfiles/models/operations/__init__.py +src/codatfiles/models/shared/file.py +src/codatfiles/models/shared/security.py +src/codatfiles/models/shared/__init__.py USAGE.md \ No newline at end of file diff --git a/files/gen.yaml b/files/gen.yaml index bcd7d72e7..3f44d8e95 100644 --- a/files/gen.yaml +++ b/files/gen.yaml @@ -1,16 +1,16 @@ configVersion: 1.0.0 management: - docChecksum: 0448d3fa262ad61467ee7c9557114cb4 + docChecksum: d5dfd334c9106568e4e7756f26553702 docVersion: 2.1.0 - speakeasyVersion: 1.19.3 - generationVersion: 2.16.7 + speakeasyVersion: 1.19.6 + generationVersion: 2.17.8 generation: telemetryEnabled: false sdkClassName: CodatFiles sdkFlattening: true singleTagPerOp: false python: - version: 0.8.4 + version: 0.9.0 author: Speakeasy description: Python Client SDK Generated by Speakeasy packageName: codat-files diff --git a/files/setup.py b/files/setup.py index 8b66fae7a..bc1ff89ef 100755 --- a/files/setup.py +++ b/files/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="codat-files", - version="0.8.4", + version="0.9.0", author="Speakeasy", description="Python Client SDK Generated by Speakeasy", long_description=long_description, diff --git a/files/src/codat/__init__.py b/files/src/codatfiles/__init__.py similarity index 100% rename from files/src/codat/__init__.py rename to files/src/codatfiles/__init__.py diff --git a/files/src/codat/files.py b/files/src/codatfiles/files.py similarity index 98% rename from files/src/codat/files.py rename to files/src/codatfiles/files.py index 0418616f8..aee3a056a 100755 --- a/files/src/codat/files.py +++ b/files/src/codatfiles/files.py @@ -2,7 +2,7 @@ import requests as requests_http from . import utils -from codat.models import operations, shared +from codatfiles.models import operations, shared from typing import Optional class Files: diff --git a/files/src/codat/models/__init__.py b/files/src/codatfiles/models/__init__.py similarity index 100% rename from files/src/codat/models/__init__.py rename to files/src/codatfiles/models/__init__.py diff --git a/files/src/codat/models/operations/__init__.py b/files/src/codatfiles/models/operations/__init__.py similarity index 100% rename from files/src/codat/models/operations/__init__.py rename to files/src/codatfiles/models/operations/__init__.py diff --git a/files/src/codat/models/operations/download_files.py b/files/src/codatfiles/models/operations/download_files.py similarity index 100% rename from files/src/codat/models/operations/download_files.py rename to files/src/codatfiles/models/operations/download_files.py diff --git a/files/src/codat/models/operations/list_files.py b/files/src/codatfiles/models/operations/list_files.py similarity index 100% rename from files/src/codat/models/operations/list_files.py rename to files/src/codatfiles/models/operations/list_files.py diff --git a/files/src/codat/models/operations/upload_files.py b/files/src/codatfiles/models/operations/upload_files.py similarity index 100% rename from files/src/codat/models/operations/upload_files.py rename to files/src/codatfiles/models/operations/upload_files.py diff --git a/files/src/codat/models/shared/__init__.py b/files/src/codatfiles/models/shared/__init__.py similarity index 100% rename from files/src/codat/models/shared/__init__.py rename to files/src/codatfiles/models/shared/__init__.py diff --git a/files/src/codat/models/shared/file.py b/files/src/codatfiles/models/shared/file.py similarity index 98% rename from files/src/codat/models/shared/file.py rename to files/src/codatfiles/models/shared/file.py index cc45782e2..0b4fab903 100755 --- a/files/src/codat/models/shared/file.py +++ b/files/src/codatfiles/models/shared/file.py @@ -2,7 +2,7 @@ from __future__ import annotations import dataclasses -from codat import utils +from codatfiles import utils from dataclasses_json import Undefined, dataclass_json from typing import Optional diff --git a/files/src/codat/models/shared/security.py b/files/src/codatfiles/models/shared/security.py similarity index 100% rename from files/src/codat/models/shared/security.py rename to files/src/codatfiles/models/shared/security.py diff --git a/files/src/codat/sdk.py b/files/src/codatfiles/sdk.py similarity index 95% rename from files/src/codat/sdk.py rename to files/src/codatfiles/sdk.py index d26100546..e7a465ce4 100755 --- a/files/src/codat/sdk.py +++ b/files/src/codatfiles/sdk.py @@ -3,7 +3,7 @@ import requests as requests_http from . import utils from .files import Files -from codat.models import shared +from codatfiles.models import shared SERVERS = [ "https://api.codat.io", @@ -11,7 +11,7 @@ ] """Contains the list of servers available to the SDK""" -class Codat: +class CodatFiles: r"""An API for uploading and downloading files from 'File Upload' Integrations. The Accounting file upload, Banking file upload, and Business documents file upload integrations provide simple file upload functionality. @@ -27,8 +27,8 @@ class Codat: _security_client: requests_http.Session _server_url: str = SERVERS[0] _language: str = "python" - _sdk_version: str = "0.8.4" - _gen_version: str = "2.16.7" + _sdk_version: str = "0.9.0" + _gen_version: str = "2.17.8" def __init__(self, security: shared.Security = None, diff --git a/files/src/codat/utils/__init__.py b/files/src/codatfiles/utils/__init__.py similarity index 100% rename from files/src/codat/utils/__init__.py rename to files/src/codatfiles/utils/__init__.py diff --git a/files/src/codat/utils/retries.py b/files/src/codatfiles/utils/retries.py similarity index 100% rename from files/src/codat/utils/retries.py rename to files/src/codatfiles/utils/retries.py diff --git a/files/src/codat/utils/utils.py b/files/src/codatfiles/utils/utils.py similarity index 100% rename from files/src/codat/utils/utils.py rename to files/src/codatfiles/utils/utils.py From 044abdbc07dfc57c9917c9d2c54740fcedc64dcd Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 12 Apr 2023 00:01:10 +0000 Subject: [PATCH 2/4] ci: regenerated with OpenAPI Doc 2.1.0, Speakeay CLI 1.19.7 --- files/RELEASES.md | 10 +++++++++- files/gen.yaml | 8 ++++---- files/setup.py | 2 +- files/src/codatfiles/sdk.py | 4 ++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/files/RELEASES.md b/files/RELEASES.md index 442e9e773..5481f8733 100644 --- a/files/RELEASES.md +++ b/files/RELEASES.md @@ -182,4 +182,12 @@ Based on: - OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml - Speakeasy CLI 1.19.6 (2.17.8) https://github.com/speakeasy-api/speakeasy ### Releases -- [PyPI v0.9.0] https://pypi.org/project/codat-files/0.9.0 - files \ No newline at end of file +- [PyPI v0.9.0] https://pypi.org/project/codat-files/0.9.0 - files + +## 2023-04-12 00:00:58 +### Changes +Based on: +- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml +- Speakeasy CLI 1.19.7 (2.17.9) https://github.com/speakeasy-api/speakeasy +### Releases +- [PyPI v0.9.1] https://pypi.org/project/codat-files/0.9.1 - files \ No newline at end of file diff --git a/files/gen.yaml b/files/gen.yaml index 3f44d8e95..2c387e7bd 100644 --- a/files/gen.yaml +++ b/files/gen.yaml @@ -2,15 +2,15 @@ configVersion: 1.0.0 management: docChecksum: d5dfd334c9106568e4e7756f26553702 docVersion: 2.1.0 - speakeasyVersion: 1.19.6 - generationVersion: 2.17.8 + speakeasyVersion: 1.19.7 + generationVersion: 2.17.9 generation: telemetryEnabled: false sdkClassName: CodatFiles - sdkFlattening: true + sdkFlattening: false singleTagPerOp: false python: - version: 0.9.0 + version: 0.9.1 author: Speakeasy description: Python Client SDK Generated by Speakeasy packageName: codat-files diff --git a/files/setup.py b/files/setup.py index bc1ff89ef..d4fdd7cf8 100755 --- a/files/setup.py +++ b/files/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="codat-files", - version="0.9.0", + version="0.9.1", author="Speakeasy", description="Python Client SDK Generated by Speakeasy", long_description=long_description, diff --git a/files/src/codatfiles/sdk.py b/files/src/codatfiles/sdk.py index e7a465ce4..5cab260f3 100755 --- a/files/src/codatfiles/sdk.py +++ b/files/src/codatfiles/sdk.py @@ -27,8 +27,8 @@ class CodatFiles: _security_client: requests_http.Session _server_url: str = SERVERS[0] _language: str = "python" - _sdk_version: str = "0.9.0" - _gen_version: str = "2.17.8" + _sdk_version: str = "0.9.1" + _gen_version: str = "2.17.9" def __init__(self, security: shared.Security = None, From a1f1fd899b426e7f04d79a8e726254ade7ab5592 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 14 Apr 2023 00:01:09 +0000 Subject: [PATCH 3/4] ci: regenerated with OpenAPI Doc 2.1.0, Speakeay CLI 1.20.0 --- files/RELEASES.md | 10 ++- files/gen.yaml | 6 +- files/pylintrc | 1 + files/setup.py | 2 +- files/src/codatfiles/sdk.py | 4 +- files/src/codatfiles/utils/utils.py | 127 +++++++++++++++------------- 6 files changed, 86 insertions(+), 64 deletions(-) diff --git a/files/RELEASES.md b/files/RELEASES.md index 5481f8733..4782f5b10 100644 --- a/files/RELEASES.md +++ b/files/RELEASES.md @@ -190,4 +190,12 @@ Based on: - OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml - Speakeasy CLI 1.19.7 (2.17.9) https://github.com/speakeasy-api/speakeasy ### Releases -- [PyPI v0.9.1] https://pypi.org/project/codat-files/0.9.1 - files \ No newline at end of file +- [PyPI v0.9.1] https://pypi.org/project/codat-files/0.9.1 - files + +## 2023-04-14 00:00:57 +### Changes +Based on: +- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml +- Speakeasy CLI 1.20.0 (2.18.0) https://github.com/speakeasy-api/speakeasy +### Releases +- [PyPI v0.10.0] https://pypi.org/project/codat-files/0.10.0 - files \ No newline at end of file diff --git a/files/gen.yaml b/files/gen.yaml index 2c387e7bd..b09e11425 100644 --- a/files/gen.yaml +++ b/files/gen.yaml @@ -2,15 +2,15 @@ configVersion: 1.0.0 management: docChecksum: d5dfd334c9106568e4e7756f26553702 docVersion: 2.1.0 - speakeasyVersion: 1.19.7 - generationVersion: 2.17.9 + speakeasyVersion: 1.20.0 + generationVersion: 2.18.0 generation: telemetryEnabled: false sdkClassName: CodatFiles sdkFlattening: false singleTagPerOp: false python: - version: 0.9.1 + version: 0.10.0 author: Speakeasy description: Python Client SDK Generated by Speakeasy packageName: codat-files diff --git a/files/pylintrc b/files/pylintrc index c2a020bfc..cf84a65c0 100755 --- a/files/pylintrc +++ b/files/pylintrc @@ -437,6 +437,7 @@ disable=raw-checker-failed, using-constant-test, too-many-statements, cyclic-import, + too-many-nested-blocks # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/files/setup.py b/files/setup.py index d4fdd7cf8..291f48058 100755 --- a/files/setup.py +++ b/files/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="codat-files", - version="0.9.1", + version="0.10.0", author="Speakeasy", description="Python Client SDK Generated by Speakeasy", long_description=long_description, diff --git a/files/src/codatfiles/sdk.py b/files/src/codatfiles/sdk.py index 5cab260f3..1f6747601 100755 --- a/files/src/codatfiles/sdk.py +++ b/files/src/codatfiles/sdk.py @@ -27,8 +27,8 @@ class CodatFiles: _security_client: requests_http.Session _server_url: str = SERVERS[0] _language: str = "python" - _sdk_version: str = "0.9.1" - _gen_version: str = "2.17.9" + _sdk_version: str = "0.10.0" + _gen_version: str = "2.18.0" def __init__(self, security: shared.Security = None, diff --git a/files/src/codatfiles/utils/utils.py b/files/src/codatfiles/utils/utils.py index 9d4fba324..986a86937 100755 --- a/files/src/codatfiles/utils/utils.py +++ b/files/src/codatfiles/utils/utils.py @@ -152,62 +152,71 @@ def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass if param_metadata is None: continue - if param_metadata.get('style', 'simple') == 'simple': - param = getattr( - path_params, field.name) if path_params is not None else None - param = _populate_from_globals( - field.name, param, 'pathParam', gbls) + param = getattr( + path_params, field.name) if path_params is not None else None + param = _populate_from_globals( + field.name, param, 'pathParam', gbls) - if param is None: - continue - - if isinstance(param, list): - pp_vals: list[str] = [] - for pp_val in param: - if pp_val is None: - continue - pp_vals.append(_val_to_string(pp_val)) - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif isinstance(param, dict): - pp_vals: list[str] = [] - for pp_key in param: - if param[pp_key] is None: - continue - if param_metadata.get('explode'): - pp_vals.append( - f"{pp_key}={_val_to_string(param[pp_key])}") - else: - pp_vals.append( - f"{pp_key},{_val_to_string(param[pp_key])}") - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif not isinstance(param, (str, int, float, complex, bool)): - pp_vals: list[str] = [] - param_fields: Tuple[Field, ...] = fields(param) - for param_field in param_fields: - param_value_metadata = param_field.metadata.get( - 'path_param') - if not param_value_metadata: - continue - - parm_name = param_value_metadata.get( - 'field_name', field.name) + if param is None: + continue - param_field_val = getattr(param, param_field.name) - if param_field_val is None: - continue - if param_metadata.get('explode'): - pp_vals.append( - f"{parm_name}={_val_to_string(param_field_val)}") - else: - pp_vals.append( - f"{parm_name},{_val_to_string(param_field_val)}") - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - else: + f_name = param_metadata.get("field_name", field.name) + serialization = param_metadata.get('serialization', '') + if serialization != '': + serialized_params = _get_serialized_params( + param_metadata, f_name, param) + for key, value in serialized_params.items(): path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', _val_to_string(param), 1) + '{' + key + '}', value, 1) + else: + if param_metadata.get('style', 'simple') == 'simple': + if isinstance(param, list): + pp_vals: list[str] = [] + for pp_val in param: + if pp_val is None: + continue + pp_vals.append(_val_to_string(pp_val)) + path = path.replace( + '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) + elif isinstance(param, dict): + pp_vals: list[str] = [] + for pp_key in param: + if param[pp_key] is None: + continue + if param_metadata.get('explode'): + pp_vals.append( + f"{pp_key}={_val_to_string(param[pp_key])}") + else: + pp_vals.append( + f"{pp_key},{_val_to_string(param[pp_key])}") + path = path.replace( + '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) + elif not isinstance(param, (str, int, float, complex, bool)): + pp_vals: list[str] = [] + param_fields: Tuple[Field, ...] = fields(param) + for param_field in param_fields: + param_value_metadata = param_field.metadata.get( + 'path_param') + if not param_value_metadata: + continue + + parm_name = param_value_metadata.get( + 'field_name', field.name) + + param_field_val = getattr(param, param_field.name) + if param_field_val is None: + continue + if param_metadata.get('explode'): + pp_vals.append( + f"{parm_name}={_val_to_string(param_field_val)}") + else: + pp_vals.append( + f"{parm_name},{_val_to_string(param_field_val)}") + path = path.replace( + '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) + else: + path = path.replace( + '{' + param_metadata.get('field_name', field.name) + '}', _val_to_string(param), 1) return server_url.removesuffix("/") + path @@ -246,8 +255,12 @@ def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[ f_name = metadata.get("field_name") serialization = metadata.get('serialization', '') if serialization != '': - params = params | _get_serialized_query_params( - metadata, f_name, value) + serialized_parms = _get_serialized_params(metadata, f_name, value) + for key, value in serialized_parms.items(): + if key in params: + params[key].extend(value) + else: + params[key] = [value] else: style = metadata.get('style', 'form') if style == 'deepObject': @@ -282,8 +295,8 @@ def get_headers(headers_params: dataclass) -> dict[str, str]: return headers -def _get_serialized_query_params(metadata: dict, field_name: str, obj: any) -> dict[str, list[str]]: - params: dict[str, list[str]] = {} +def _get_serialized_params(metadata: dict, field_name: str, obj: any) -> dict[str, str]: + params: dict[str, str] = {} serialization = metadata.get('serialization', '') if serialization == 'json': From 4500d5fe8bbf6fd35d2e1c74685da01a92f298bf Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 18 Apr 2023 00:01:01 +0000 Subject: [PATCH 4/4] ci: regenerated with OpenAPI Doc 2.1.0, Speakeay CLI 1.20.1 --- files/RELEASES.md | 10 ++++++- files/gen.yaml | 9 +++---- files/setup.py | 2 +- files/src/codatfiles/files.py | 51 ++++++++++++++++++++++++++++++----- files/src/codatfiles/sdk.py | 4 +-- 5 files changed, 61 insertions(+), 15 deletions(-) diff --git a/files/RELEASES.md b/files/RELEASES.md index 4782f5b10..65375bab3 100644 --- a/files/RELEASES.md +++ b/files/RELEASES.md @@ -198,4 +198,12 @@ Based on: - OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml - Speakeasy CLI 1.20.0 (2.18.0) https://github.com/speakeasy-api/speakeasy ### Releases -- [PyPI v0.10.0] https://pypi.org/project/codat-files/0.10.0 - files \ No newline at end of file +- [PyPI v0.10.0] https://pypi.org/project/codat-files/0.10.0 - files + +## 2023-04-18 00:00:51 +### Changes +Based on: +- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml +- Speakeasy CLI 1.20.1 (2.18.1) https://github.com/speakeasy-api/speakeasy +### Releases +- [PyPI v0.10.1] https://pypi.org/project/codat-files/0.10.1 - files \ No newline at end of file diff --git a/files/gen.yaml b/files/gen.yaml index b09e11425..70c78bb84 100644 --- a/files/gen.yaml +++ b/files/gen.yaml @@ -1,16 +1,15 @@ configVersion: 1.0.0 management: - docChecksum: d5dfd334c9106568e4e7756f26553702 + docChecksum: 3cf265fb28f03ccb976cee9c56372470 docVersion: 2.1.0 - speakeasyVersion: 1.20.0 - generationVersion: 2.18.0 + speakeasyVersion: 1.20.1 + generationVersion: 2.18.1 generation: telemetryEnabled: false sdkClassName: CodatFiles - sdkFlattening: false singleTagPerOp: false python: - version: 0.10.0 + version: 0.10.1 author: Speakeasy description: Python Client SDK Generated by Speakeasy packageName: codat-files diff --git a/files/setup.py b/files/setup.py index 291f48058..9119fcdaa 100755 --- a/files/setup.py +++ b/files/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="codat-files", - version="0.10.0", + version="0.10.1", author="Speakeasy", description="Python Client SDK Generated by Speakeasy", long_description=long_description, diff --git a/files/src/codatfiles/files.py b/files/src/codatfiles/files.py index aee3a056a..9382eb3f4 100755 --- a/files/src/codatfiles/files.py +++ b/files/src/codatfiles/files.py @@ -22,7 +22,7 @@ def __init__(self, client: requests_http.Session, security_client: requests_http self._sdk_version = sdk_version self._gen_version = gen_version - def download_files(self, request: operations.DownloadFilesRequest) -> operations.DownloadFilesResponse: + def download_files(self, request: operations.DownloadFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DownloadFilesResponse: r"""Download all files for a company You can specify a date to download specific files for. """ @@ -34,7 +34,20 @@ def download_files(self, request: operations.DownloadFilesRequest) -> operations client = self._security_client - http_res = client.request('GET', url, params=query_params) + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', True) + retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000) + + + def do_request(): + return client.request('GET', url, params=query_params) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) content_type = http_res.headers.get('Content-Type') res = operations.DownloadFilesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -45,7 +58,7 @@ def download_files(self, request: operations.DownloadFilesRequest) -> operations return res - def list_files(self, request: operations.ListFilesRequest) -> operations.ListFilesResponse: + def list_files(self, request: operations.ListFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListFilesResponse: r"""List all files uploaded by a company Returns an array of files that have been uploaded for a given company. """ @@ -56,7 +69,20 @@ def list_files(self, request: operations.ListFilesRequest) -> operations.ListFil client = self._security_client - http_res = client.request('GET', url) + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', True) + retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000) + + + def do_request(): + return client.request('GET', url) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) content_type = http_res.headers.get('Content-Type') res = operations.ListFilesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -68,7 +94,7 @@ def list_files(self, request: operations.ListFilesRequest) -> operations.ListFil return res - def upload_files(self, request: operations.UploadFilesRequest) -> operations.UploadFilesResponse: + def upload_files(self, request: operations.UploadFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UploadFilesResponse: r"""Upload files for a company Upload files """ @@ -83,7 +109,20 @@ def upload_files(self, request: operations.UploadFilesRequest) -> operations.Upl client = self._security_client - http_res = client.request('POST', url, data=data, files=form, headers=headers) + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', True) + retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000) + + + def do_request(): + return client.request('POST', url, data=data, files=form, headers=headers) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) content_type = http_res.headers.get('Content-Type') res = operations.UploadFilesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/files/src/codatfiles/sdk.py b/files/src/codatfiles/sdk.py index 1f6747601..3ef6f94d9 100755 --- a/files/src/codatfiles/sdk.py +++ b/files/src/codatfiles/sdk.py @@ -27,8 +27,8 @@ class CodatFiles: _security_client: requests_http.Session _server_url: str = SERVERS[0] _language: str = "python" - _sdk_version: str = "0.10.0" - _gen_version: str = "2.18.0" + _sdk_version: str = "0.10.1" + _gen_version: str = "2.18.1" def __init__(self, security: shared.Security = None,