Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 0.0.1, Speakeasy CLI 1.116.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Nov 9, 2023
1 parent f9103bf commit 9353e41
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 - .
- [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 - .
7 changes: 6 additions & 1 deletion docs/sdks/general/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General
(*.general*)
(*general*)

### Available Operations

Expand Down Expand Up @@ -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 | */* |
12 changes: 7 additions & 5 deletions gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: .
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="unstructured-client",
version="0.13.0",
version="0.14.0",
author="Unstructured",
description="Python Client SDK for Unstructured API",
long_description=long_description,
Expand Down
6 changes: 5 additions & 1 deletion src/unstructured_client/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/unstructured_client/models/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .sdkerror import *
from .validationerror import *

__all__ = ["HTTPValidationError","Loc","SDKError","ValidationError"]
__all__ = ["HTTPValidationError","SDKError","ValidationError"]
5 changes: 0 additions & 5 deletions src/unstructured_client/models/errors/validationerror.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
from unstructured_client import utils


@dataclasses.dataclass
class Loc:
pass


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class ValidationError:
Expand Down
12 changes: 5 additions & 7 deletions src/unstructured_client/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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()

Expand Down
11 changes: 6 additions & 5 deletions src/unstructured_client/sdkconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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]]:
Expand Down

0 comments on commit 9353e41

Please sign in to comment.