From 9353e419a79c6453020b50dee5d98b31c60d27c5 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 9 Nov 2023 00:18:16 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 0.0.1, Speakeasy CLI 1.116.0 --- README.md | 2 +- RELEASES.md | 12 +++++++++++- docs/sdks/general/README.md | 7 ++++++- gen.yaml | 12 +++++++----- setup.py | 2 +- src/unstructured_client/general.py | 6 +++++- src/unstructured_client/models/errors/__init__.py | 2 +- .../models/errors/validationerror.py | 5 ----- src/unstructured_client/sdk.py | 12 +++++------- src/unstructured_client/sdkconfiguration.py | 11 ++++++----- 10 files changed, 43 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 4bcdf722..878a76e0 100755 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ s = unstructured_client.UnstructuredClient( The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object. -For example, you could specify a header for every request that your sdk makes as follows: +For example, you could specify a header for every request that this sdk makes as follows: ```python import unstructured_client diff --git a/RELEASES.md b/RELEASES.md index c77ec9dd..0fd986d8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -244,4 +244,14 @@ Based on: ### Generated - [python v0.13.0] . ### Releases -- [PyPI v0.13.0] https://pypi.org/project/unstructured-client/0.13.0 - . \ No newline at end of file +- [PyPI v0.13.0] https://pypi.org/project/unstructured-client/0.13.0 - . + +## 2023-11-09 00:18:03 +### Changes +Based on: +- OpenAPI Doc 0.0.1 +- Speakeasy CLI 1.116.0 (2.185.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.14.0] . +### Releases +- [PyPI v0.14.0] https://pypi.org/project/unstructured-client/0.14.0 - . \ No newline at end of file diff --git a/docs/sdks/general/README.md b/docs/sdks/general/README.md index d48221ea..5f722ac7 100755 --- a/docs/sdks/general/README.md +++ b/docs/sdks/general/README.md @@ -1,5 +1,5 @@ # General -(*.general*) +(*general*) ### Available Operations @@ -65,4 +65,9 @@ if res.elements is not None: ### Response **[operations.PartitionResponse](../../models/operations/partitionresponse.md)** +### Errors +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 400-600 | */* | diff --git a/gen.yaml b/gen.yaml index 42e9fa2e..1f0ce33d 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,23 +2,23 @@ configVersion: 1.0.0 management: docChecksum: bf57420eebd40f2b1d166092f01e3927 docVersion: 0.0.1 - speakeasyVersion: 1.114.1 - generationVersion: 2.181.1 + speakeasyVersion: 1.116.0 + generationVersion: 2.185.0 generation: comments: {} sdkClassName: unstructured_client repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git features: python: - core: 4.1.0 + core: 4.1.2 examples: 2.81.3 - globalSecurity: 2.82.0 + globalSecurity: 2.83.0 globalServerURLs: 2.82.0 nameOverrides: 2.81.1 retries: 2.82.0 serverIDs: 2.81.1 python: - version: 0.13.0 + version: 0.14.0 author: Unstructured clientServerStatusCodesAsErrors: true description: Python Client SDK for Unstructured API @@ -31,8 +31,10 @@ python: operations: models/operations shared: models/shared webhooks: models/webhooks + inputModelSuffix: input installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git maxMethodParams: 0 + outputModelSuffix: output packageName: unstructured-client published: true repoSubDirectory: . diff --git a/setup.py b/setup.py index 4617bf54..57a23dc4 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="unstructured-client", - version="0.13.0", + version="0.14.0", author="Unstructured", description="Python Client SDK for Unstructured API", long_description=long_description, diff --git a/src/unstructured_client/general.py b/src/unstructured_client/general.py index dca3af67..ca13d228 100755 --- a/src/unstructured_client/general.py +++ b/src/unstructured_client/general.py @@ -12,6 +12,7 @@ def __init__(self, sdk_config: SDKConfiguration) -> None: self.sdk_configuration = sdk_config + def partition(self, request: shared.PartitionParameters, retries: Optional[utils.RetryConfig] = None) -> operations.PartitionResponse: r"""Pipeline 1""" base_url = utils.template_url(*self.sdk_configuration.get_server_details()) @@ -24,7 +25,10 @@ def partition(self, request: shared.PartitionParameters, retries: Optional[utils headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.security_client + if callable(self.sdk_configuration.security): + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) + else: + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) global_retry_config = self.sdk_configuration.retry_config retry_config = retries diff --git a/src/unstructured_client/models/errors/__init__.py b/src/unstructured_client/models/errors/__init__.py index 060713c7..994f4d37 100755 --- a/src/unstructured_client/models/errors/__init__.py +++ b/src/unstructured_client/models/errors/__init__.py @@ -4,4 +4,4 @@ from .sdkerror import * from .validationerror import * -__all__ = ["HTTPValidationError","Loc","SDKError","ValidationError"] +__all__ = ["HTTPValidationError","SDKError","ValidationError"] diff --git a/src/unstructured_client/models/errors/validationerror.py b/src/unstructured_client/models/errors/validationerror.py index c268836a..c1b52e4d 100755 --- a/src/unstructured_client/models/errors/validationerror.py +++ b/src/unstructured_client/models/errors/validationerror.py @@ -7,11 +7,6 @@ from unstructured_client import utils -@dataclasses.dataclass -class Loc: - pass - - @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass class ValidationError: diff --git a/src/unstructured_client/sdk.py b/src/unstructured_client/sdk.py index 3a4e8821..52eda1bc 100755 --- 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: 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,15 +39,13 @@ def __init__(self, if client is None: client = requests_http.Session() - - security_client = utils.configure_security_client(client, shared.Security(api_key_auth = api_key_auth)) - + security = shared.Security(api_key_auth = api_key_auth) if server_url is not None: if url_params is not None: server_url = utils.template_url(server_url, url_params) - self.sdk_configuration = SDKConfiguration(client, security_client, server_url, server, retry_config=retry_config) + self.sdk_configuration = SDKConfiguration(client, security, server_url, server, retry_config=retry_config) self._init_sdks() diff --git a/src/unstructured_client/sdkconfiguration.py b/src/unstructured_client/sdkconfiguration.py index 031632ca..bfa4f592 100755 --- a/src/unstructured_client/sdkconfiguration.py +++ b/src/unstructured_client/sdkconfiguration.py @@ -2,9 +2,10 @@ import requests from dataclasses import dataclass -from typing import Dict, Tuple +from typing import Dict, Tuple, Callable, Union from .utils.retries import RetryConfig from .utils import utils +from unstructured_client.models import shared SERVER_PROD = 'prod' @@ -21,14 +22,14 @@ @dataclass class SDKConfiguration: client: requests.Session - security_client: requests.Session + security: Union[shared.Security,Callable[[], shared.Security]] = None server_url: str = '' server: str = '' language: str = 'python' openapi_doc_version: str = '0.0.1' - sdk_version: str = '0.13.0' - gen_version: str = '2.181.1' - user_agent: str = 'speakeasy-sdk/python 0.13.0 2.181.1 0.0.1 unstructured-client' + sdk_version: str = '0.14.0' + gen_version: str = '2.185.0' + user_agent: str = 'speakeasy-sdk/python 0.14.0 2.185.0 0.0.1 unstructured-client' retry_config: RetryConfig = None def get_server_details(self) -> Tuple[str, Dict[str, str]]: