From c49cc2557d528856d477179e322a55fd7ad09720 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 12 Jan 2024 00:19:43 +0000 Subject: [PATCH 1/7] ci: regenerated with OpenAPI Doc 0.0.1, Speakeasy CLI 1.136.1 --- .speakeasy/gen.lock | 2 +- RELEASES.md | 10 ++++++++++ setup.py | 1 - src/unstructured_client/sdkconfiguration.py | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 25e4d1a4..343d3db0 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -4,7 +4,7 @@ management: docChecksum: 559aacf6828c62bd379326645382b3ba docVersion: 0.0.1 speakeasyVersion: internal - generationVersion: 2.230.1 + generationVersion: 2.231.0 releaseVersion: 0.15.2 configChecksum: c7f5587d10f16ad71c809e8627e64175 repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git diff --git a/RELEASES.md b/RELEASES.md index b68bee7c..f1455914 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -344,4 +344,14 @@ Based on: ### Generated - [python v0.15.2] . ### Releases +- [PyPI v0.15.2] https://pypi.org/project/unstructured-client/0.15.2 - . + +## 2024-01-12 00:19:36 +### Changes +Based on: +- OpenAPI Doc 0.0.1 +- Speakeasy CLI 1.136.1 (2.231.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.15.2] . +### Releases - [PyPI v0.15.2] https://pypi.org/project/unstructured-client/0.15.2 - . \ No newline at end of file diff --git a/setup.py b/setup.py index 4fca2489..a914284b 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,5 @@ "dev":["pylint==2.16.2"] }, package_dir={'': 'src'}, - license="MIT License", python_requires='>=3.8' ) diff --git a/src/unstructured_client/sdkconfiguration.py b/src/unstructured_client/sdkconfiguration.py index bb4fd2af..9dc8fff9 100644 --- a/src/unstructured_client/sdkconfiguration.py +++ b/src/unstructured_client/sdkconfiguration.py @@ -28,8 +28,8 @@ class SDKConfiguration: language: str = 'python' openapi_doc_version: str = '0.0.1' sdk_version: str = '0.15.2' - gen_version: str = '2.230.1' - user_agent: str = 'speakeasy-sdk/python 0.15.2 2.230.1 0.0.1 unstructured-client' + gen_version: str = '2.231.0' + user_agent: str = 'speakeasy-sdk/python 0.15.2 2.231.0 0.0.1 unstructured-client' retry_config: RetryConfig = None def get_server_details(self) -> Tuple[str, Dict[str, str]]: From 72584a8eea23bd46e0cd0fdaef6b0fb763d90090 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 16 Jan 2024 00:20:05 +0000 Subject: [PATCH 2/7] ci: regenerated with OpenAPI Doc 0.0.1, Speakeasy CLI 1.141.1 --- .speakeasy/gen.lock | 8 ++++---- RELEASES.md | 12 +++++++++++- gen.yaml | 2 +- setup.py | 2 +- src/unstructured_client/sdkconfiguration.py | 6 +++--- src/unstructured_client/utils/retries.py | 4 ++-- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 343d3db0..217179a5 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -4,9 +4,9 @@ management: docChecksum: 559aacf6828c62bd379326645382b3ba docVersion: 0.0.1 speakeasyVersion: internal - generationVersion: 2.231.0 - releaseVersion: 0.15.2 - configChecksum: c7f5587d10f16ad71c809e8627e64175 + generationVersion: 2.233.2 + releaseVersion: 0.15.3 + configChecksum: 2e2a4386f71b10d46d24683e1b2cb31c repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -18,7 +18,7 @@ features: globalSecurity: 2.83.1 globalServerURLs: 2.82.1 nameOverrides: 2.81.1 - retries: 2.82.0 + retries: 2.82.1 serverIDs: 2.81.1 unions: 2.82.5 generatedFiles: diff --git a/RELEASES.md b/RELEASES.md index f1455914..b35c2594 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -354,4 +354,14 @@ Based on: ### Generated - [python v0.15.2] . ### Releases -- [PyPI v0.15.2] https://pypi.org/project/unstructured-client/0.15.2 - . \ No newline at end of file +- [PyPI v0.15.2] https://pypi.org/project/unstructured-client/0.15.2 - . + +## 2024-01-16 00:19:58 +### Changes +Based on: +- OpenAPI Doc 0.0.1 +- Speakeasy CLI 1.141.1 (2.233.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.15.3] . +### Releases +- [PyPI v0.15.3] https://pypi.org/project/unstructured-client/0.15.3 - . \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index 86087780..c033f1c7 100644 --- a/gen.yaml +++ b/gen.yaml @@ -6,7 +6,7 @@ generation: fixes: nameResolutionDec2023: false python: - version: 0.15.2 + version: 0.15.3 author: Unstructured clientServerStatusCodesAsErrors: true description: Python Client SDK for Unstructured API diff --git a/setup.py b/setup.py index a914284b..e31c6391 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="unstructured-client", - version="0.15.2", + version="0.15.3", author="Unstructured", description="Python Client SDK for Unstructured API", long_description=long_description, diff --git a/src/unstructured_client/sdkconfiguration.py b/src/unstructured_client/sdkconfiguration.py index 9dc8fff9..3c2397bf 100644 --- a/src/unstructured_client/sdkconfiguration.py +++ b/src/unstructured_client/sdkconfiguration.py @@ -27,9 +27,9 @@ class SDKConfiguration: server: str = '' language: str = 'python' openapi_doc_version: str = '0.0.1' - sdk_version: str = '0.15.2' - gen_version: str = '2.231.0' - user_agent: str = 'speakeasy-sdk/python 0.15.2 2.231.0 0.0.1 unstructured-client' + sdk_version: str = '0.15.3' + gen_version: str = '2.233.2' + user_agent: str = 'speakeasy-sdk/python 0.15.3 2.233.2 0.0.1 unstructured-client' retry_config: RetryConfig = None def get_server_details(self) -> Tuple[str, Dict[str, str]]: diff --git a/src/unstructured_client/utils/retries.py b/src/unstructured_client/utils/retries.py index 25f49a1f..8eba0940 100644 --- a/src/unstructured_client/utils/retries.py +++ b/src/unstructured_client/utils/retries.py @@ -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 From fbfef1a67e2cb09ff1a8cb35ed7abf8182ff60f1 Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Tue, 16 Jan 2024 13:27:09 -0500 Subject: [PATCH 3/7] Revert license change --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e31c6391..d9a09a73 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,8 @@ "urllib3>=1.26.18", ], extras_require={ - "dev":["pylint==2.16.2"] + "dev":["pylint==2.16.2"], + license="MIT License", }, package_dir={'': 'src'}, python_requires='>=3.8' From 47d7765de22d6f1c34e7ec07b964360240606bdd Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Tue, 16 Jan 2024 13:27:46 -0500 Subject: [PATCH 4/7] Revert license change --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index d9a09a73..de23546e 100644 --- a/setup.py +++ b/setup.py @@ -33,9 +33,9 @@ "urllib3>=1.26.18", ], extras_require={ - "dev":["pylint==2.16.2"], - license="MIT License", + "dev":["pylint==2.16.2"] }, package_dir={'': 'src'}, - python_requires='>=3.8' + python_requires='>=3.8', + license="MIT License", ) From e3e49d643684e11a3b994ace5e97a5cfc7438e22 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 17 Jan 2024 00:19:59 +0000 Subject: [PATCH 5/7] ci: regenerated with OpenAPI Doc 0.0.1, Speakeasy CLI 1.142.1 --- .speakeasy/gen.lock | 8 ++++---- RELEASES.md | 12 +++++++++++- gen.yaml | 2 +- setup.py | 5 ++--- src/unstructured_client/sdk.py | 12 ++++++++---- src/unstructured_client/sdkconfiguration.py | 6 +++--- 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 217179a5..2f893e08 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -4,16 +4,16 @@ management: docChecksum: 559aacf6828c62bd379326645382b3ba docVersion: 0.0.1 speakeasyVersion: internal - generationVersion: 2.233.2 - releaseVersion: 0.15.3 - configChecksum: 2e2a4386f71b10d46d24683e1b2cb31c + generationVersion: 2.234.3 + releaseVersion: 0.15.4 + configChecksum: d09237e1be34fee035ce9f749b8e95cd repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git published: true features: python: - core: 4.4.1 + core: 4.4.2 examples: 2.81.3 globalSecurity: 2.83.1 globalServerURLs: 2.82.1 diff --git a/RELEASES.md b/RELEASES.md index b35c2594..ef8f4c8c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -364,4 +364,14 @@ Based on: ### Generated - [python v0.15.3] . ### Releases -- [PyPI v0.15.3] https://pypi.org/project/unstructured-client/0.15.3 - . \ No newline at end of file +- [PyPI v0.15.3] https://pypi.org/project/unstructured-client/0.15.3 - . + +## 2024-01-17 00:19:51 +### Changes +Based on: +- OpenAPI Doc 0.0.1 +- Speakeasy CLI 1.142.1 (2.234.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.15.4] . +### Releases +- [PyPI v0.15.4] https://pypi.org/project/unstructured-client/0.15.4 - . \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index c033f1c7..5e75d9f6 100644 --- a/gen.yaml +++ b/gen.yaml @@ -6,7 +6,7 @@ generation: fixes: nameResolutionDec2023: false python: - version: 0.15.3 + version: 0.15.4 author: Unstructured clientServerStatusCodesAsErrors: true description: Python Client SDK for Unstructured API diff --git a/setup.py b/setup.py index de23546e..23da86d8 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="unstructured-client", - version="0.15.3", + version="0.15.4", author="Unstructured", description="Python Client SDK for Unstructured API", long_description=long_description, @@ -36,6 +36,5 @@ "dev":["pylint==2.16.2"] }, package_dir={'': 'src'}, - python_requires='>=3.8', - license="MIT License", + python_requires='>=3.8' ) diff --git a/src/unstructured_client/sdk.py b/src/unstructured_client/sdk.py index 4ebbcc63..18fb5cb1 100644 --- a/src/unstructured_client/sdk.py +++ b/src/unstructured_client/sdk.py @@ -3,7 +3,7 @@ import requests as requests_http from .general import General from .sdkconfiguration import SDKConfiguration -from typing import Dict +from typing import Callable, Dict, Union from unstructured_client import utils from unstructured_client.models import shared @@ -14,7 +14,7 @@ class UnstructuredClient: sdk_configuration: SDKConfiguration def __init__(self, - api_key_auth: str , + api_key_auth: Union[str, Callable[[], str]], server: str = None, server_url: str = None, url_params: Dict[str, str] = None, @@ -24,7 +24,7 @@ def __init__(self, """Instantiates the SDK configuring it with the provided parameters. :param api_key_auth: The api_key_auth required for authentication - :type api_key_auth: Union[str,Callable[[], str]] + :type api_key_auth: Union[str, Callable[[], str]] :param server: The server by name to use for all operations :type server: str :param server_url: The server URL to use for all operations @@ -39,7 +39,11 @@ def __init__(self, if client is None: client = requests_http.Session() - security = shared.Security(api_key_auth = api_key_auth) + if callable(api_key_auth): + def security(): + return shared.Security(api_key_auth = api_key_auth()) + else: + security = shared.Security(api_key_auth = api_key_auth) if server_url is not None: if url_params is not None: diff --git a/src/unstructured_client/sdkconfiguration.py b/src/unstructured_client/sdkconfiguration.py index 3c2397bf..2557e0c9 100644 --- a/src/unstructured_client/sdkconfiguration.py +++ b/src/unstructured_client/sdkconfiguration.py @@ -27,9 +27,9 @@ class SDKConfiguration: server: str = '' language: str = 'python' openapi_doc_version: str = '0.0.1' - sdk_version: str = '0.15.3' - gen_version: str = '2.233.2' - user_agent: str = 'speakeasy-sdk/python 0.15.3 2.233.2 0.0.1 unstructured-client' + sdk_version: str = '0.15.4' + gen_version: str = '2.234.3' + user_agent: str = 'speakeasy-sdk/python 0.15.4 2.234.3 0.0.1 unstructured-client' retry_config: RetryConfig = None def get_server_details(self) -> Tuple[str, Dict[str, str]]: From 95073f8ade0f8e8559734791518148d45c7f6301 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 19 Jan 2024 00:20:05 +0000 Subject: [PATCH 6/7] ci: regenerated with OpenAPI Doc 0.0.1, Speakeasy CLI 1.147.0 --- .speakeasy/gen.lock | 8 ++++---- RELEASES.md | 12 +++++++++++- gen.yaml | 2 +- setup.py | 2 +- src/unstructured_client/sdkconfiguration.py | 6 +++--- src/unstructured_client/utils/utils.py | 11 +++++++---- 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2f893e08..2f867673 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -4,9 +4,9 @@ management: docChecksum: 559aacf6828c62bd379326645382b3ba docVersion: 0.0.1 speakeasyVersion: internal - generationVersion: 2.234.3 - releaseVersion: 0.15.4 - configChecksum: d09237e1be34fee035ce9f749b8e95cd + generationVersion: 2.237.2 + releaseVersion: 0.15.5 + configChecksum: 5138d0e0d09d018eeec74356c4b3fef5 repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -15,7 +15,7 @@ features: python: core: 4.4.2 examples: 2.81.3 - globalSecurity: 2.83.1 + globalSecurity: 2.83.2 globalServerURLs: 2.82.1 nameOverrides: 2.81.1 retries: 2.82.1 diff --git a/RELEASES.md b/RELEASES.md index ef8f4c8c..1d847c4c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -374,4 +374,14 @@ Based on: ### Generated - [python v0.15.4] . ### Releases -- [PyPI v0.15.4] https://pypi.org/project/unstructured-client/0.15.4 - . \ No newline at end of file +- [PyPI v0.15.4] https://pypi.org/project/unstructured-client/0.15.4 - . + +## 2024-01-19 00:19:58 +### Changes +Based on: +- OpenAPI Doc 0.0.1 +- Speakeasy CLI 1.147.0 (2.237.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.15.5] . +### Releases +- [PyPI v0.15.5] https://pypi.org/project/unstructured-client/0.15.5 - . \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index 5e75d9f6..2d441262 100644 --- a/gen.yaml +++ b/gen.yaml @@ -6,7 +6,7 @@ generation: fixes: nameResolutionDec2023: false python: - version: 0.15.4 + version: 0.15.5 author: Unstructured clientServerStatusCodesAsErrors: true description: Python Client SDK for Unstructured API diff --git a/setup.py b/setup.py index 23da86d8..999c4b84 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="unstructured-client", - version="0.15.4", + version="0.15.5", author="Unstructured", description="Python Client SDK for Unstructured API", long_description=long_description, diff --git a/src/unstructured_client/sdkconfiguration.py b/src/unstructured_client/sdkconfiguration.py index 2557e0c9..b1e695f1 100644 --- a/src/unstructured_client/sdkconfiguration.py +++ b/src/unstructured_client/sdkconfiguration.py @@ -27,9 +27,9 @@ class SDKConfiguration: server: str = '' language: str = 'python' openapi_doc_version: str = '0.0.1' - sdk_version: str = '0.15.4' - gen_version: str = '2.234.3' - user_agent: str = 'speakeasy-sdk/python 0.15.4 2.234.3 0.0.1 unstructured-client' + sdk_version: str = '0.15.5' + gen_version: str = '2.237.2' + user_agent: str = 'speakeasy-sdk/python 0.15.5 2.237.2 0.0.1 unstructured-client' retry_config: RetryConfig = None def get_server_details(self) -> Tuple[str, Dict[str, str]]: diff --git a/src/unstructured_client/utils/utils.py b/src/unstructured_client/utils/utils.py index 1a60d406..f7096142 100644 --- a/src/unstructured_client/utils/utils.py +++ b/src/unstructured_client/utils/utils.py @@ -110,19 +110,22 @@ def _parse_security_scheme_value(client: SecurityClient, scheme_metadata: Dict, else: raise Exception('not supported') elif scheme_type == "openIdConnect": - client.client.headers[header_name] = value + client.client.headers[header_name] = _apply_bearer(value) elif scheme_type == 'oauth2': - client.client.headers[header_name] = value + client.client.headers[header_name] = _apply_bearer(value) elif scheme_type == 'http': if sub_type == 'bearer': - client.client.headers[header_name] = value.lower().startswith( - 'bearer ') and value or f'Bearer {value}' + client.client.headers[header_name] = _apply_bearer(value) else: raise Exception('not supported') else: raise Exception('not supported') +def _apply_bearer(token: str) -> str: + return token.lower().startswith('bearer ') and token or f'Bearer {token}' + + def _parse_basic_auth_scheme(client: SecurityClient, scheme: dataclass): username = "" password = "" From b9386f1b5942b89a5ad1cad428e0863e4bad8554 Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Wed, 24 Jan 2024 11:05:35 -0500 Subject: [PATCH 7/7] Revert license change --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 999c4b84..1d9bf600 100644 --- a/setup.py +++ b/setup.py @@ -36,5 +36,6 @@ "dev":["pylint==2.16.2"] }, package_dir={'': 'src'}, + license="MIT License", python_requires='>=3.8' )