Skip to content

Commit 1577c37

Browse files
authored
Merge pull request #14 from Unstructured-IO/speakeasy-sdk-regen-1700093948
chore: 🐝 Update SDK - Generate
2 parents 972af88 + 66f280b commit 1577c37

36 files changed

+121
-31
lines changed

.gitattributes

100755100644
File mode changed.

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,11 @@ s = unstructured_client.UnstructuredClient(
9797
<!-- No Server Selection -->
9898

9999
<!-- Start Custom HTTP Client -->
100-
# Custom HTTP Client
100+
## Custom HTTP Client
101101

102102
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.
103103

104-
105104
For example, you could specify a header for every request that this sdk makes as follows:
106-
107105
```python
108106
import unstructured_client
109107
import requests

RELEASES.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,34 @@ Based on:
254254
### Generated
255255
- [python v0.14.0] .
256256
### Releases
257-
- [PyPI v0.14.0] https://pypi.org/project/unstructured-client/0.14.0 - .
257+
- [PyPI v0.14.0] https://pypi.org/project/unstructured-client/0.14.0 - .
258+
259+
## 2023-11-16 00:19:06
260+
### Changes
261+
Based on:
262+
- OpenAPI Doc 0.0.1
263+
- Speakeasy CLI 1.120.3 (2.192.1) https://github.com/speakeasy-api/speakeasy
264+
### Generated
265+
- [python v0.14.1] .
266+
### Releases
267+
- [PyPI v0.14.1] https://pypi.org/project/unstructured-client/0.14.1 - .
268+
269+
## 2023-11-18 00:18:40
270+
### Changes
271+
Based on:
272+
- OpenAPI Doc 0.0.1
273+
- Speakeasy CLI 1.121.1 (2.194.1) https://github.com/speakeasy-api/speakeasy
274+
### Generated
275+
- [python v0.14.2] .
276+
### Releases
277+
- [PyPI v0.14.2] https://pypi.org/project/unstructured-client/0.14.2 - .
278+
279+
## 2023-11-21 00:19:25
280+
### Changes
281+
Based on:
282+
- OpenAPI Doc 0.0.1
283+
- Speakeasy CLI 1.121.3 (2.195.2) https://github.com/speakeasy-api/speakeasy
284+
### Generated
285+
- [python v0.14.3] .
286+
### Releases
287+
- [PyPI v0.14.3] https://pypi.org/project/unstructured-client/0.14.3 - .

USAGE.md

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<!-- Start SDK Example Usage -->
2-
3-
42
```python
53
import unstructured_client
64
from unstructured_client.models import shared

docs/models/errors/httpvalidationerror.md

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
| Field | Type | Required | Description |
77
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
8-
| `detail` | List[[errors.ValidationError](../../models/errors/validationerror.md)] | :heavy_minus_sign: | N/A |
8+
| `detail` | List[[shared.ValidationError](../../models/shared/validationerror.md)] | :heavy_minus_sign: | N/A |

docs/models/operations/partitionresponse.md

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation |
99
| `elements` | List[*Any*] | :heavy_minus_sign: | Successful Response |
1010
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
11-
| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |
11+
| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |

docs/models/shared/files.md

100755100644
File mode changed.
File renamed without changes.

docs/models/shared/partitionparameters.md

100755100644
File mode changed.

docs/models/shared/security.md

100755100644
File mode changed.

docs/models/errors/validationerror.md renamed to docs/models/shared/validationerror.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
| Field | Type | Required | Description |
77
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
8-
| `loc` | List[[Union[str, int]](../../models/errors/loc.md)] | :heavy_check_mark: | N/A |
8+
| `loc` | List[[Union[str, int]](../../models/shared/loc.md)] | :heavy_check_mark: | N/A |
99
| `msg` | *str* | :heavy_check_mark: | N/A |
1010
| `type` | *str* | :heavy_check_mark: | N/A |

docs/models/utils/retryconfig.md

100755100644
File mode changed.

docs/sdks/general/README.md

100755100644
File mode changed.

docs/sdks/unstructuredclient/README.md

100755100644
File mode changed.

files.gen

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ src/unstructured_client/utils/__init__.py
88
src/unstructured_client/utils/retries.py
99
src/unstructured_client/utils/utils.py
1010
src/unstructured_client/models/errors/sdkerror.py
11+
tests/helpers.py
1112
src/unstructured_client/models/operations/partition.py
1213
src/unstructured_client/models/errors/httpvalidationerror.py
13-
src/unstructured_client/models/errors/validationerror.py
14+
src/unstructured_client/models/shared/validationerror.py
1415
src/unstructured_client/models/shared/partition_parameters.py
1516
src/unstructured_client/models/shared/security.py
1617
src/unstructured_client/models/__init__.py
@@ -20,8 +21,8 @@ src/unstructured_client/models/shared/__init__.py
2021
USAGE.md
2122
docs/models/operations/partitionresponse.md
2223
docs/models/errors/httpvalidationerror.md
23-
docs/models/errors/loc.md
24-
docs/models/errors/validationerror.md
24+
docs/models/shared/loc.md
25+
docs/models/shared/validationerror.md
2526
docs/models/shared/files.md
2627
docs/models/shared/partitionparameters.md
2728
docs/models/shared/security.md

gen.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ configVersion: 1.0.0
22
management:
33
docChecksum: bf57420eebd40f2b1d166092f01e3927
44
docVersion: 0.0.1
5-
speakeasyVersion: 1.116.0
6-
generationVersion: 2.185.0
5+
speakeasyVersion: 1.121.3
6+
generationVersion: 2.195.2
77
generation:
88
comments: {}
99
sdkClassName: unstructured_client
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
11+
usageSnippets:
12+
optionalPropertyRendering: withExample
1113
features:
1214
python:
13-
core: 4.1.2
15+
core: 4.1.5
1416
examples: 2.81.3
1517
globalSecurity: 2.83.0
16-
globalServerURLs: 2.82.0
18+
globalServerURLs: 2.82.1
1719
nameOverrides: 2.81.1
1820
retries: 2.82.0
1921
serverIDs: 2.81.1
2022
python:
21-
version: 0.14.0
23+
version: 0.14.3
2224
author: Unstructured
2325
clientServerStatusCodesAsErrors: true
2426
description: Python Client SDK for Unstructured API

pylintrc

100755100644
File mode changed.

setup.py

100755100644
+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name="unstructured-client",
13-
version="0.14.0",
13+
version="0.14.3",
1414
author="Unstructured",
1515
description="Python Client SDK for Unstructured API",
1616
long_description=long_description,
@@ -30,7 +30,7 @@
3030
"six>=1.16.0",
3131
"typing-inspect>=0.9.0",
3232
"typing_extensions>=4.7.1",
33-
"urllib3>=2.0.4",
33+
"urllib3>=1.26.18",
3434
],
3535
extras_require={
3636
"dev":["pylint==2.16.2"]

src/unstructured_client/__init__.py

100755100644
File mode changed.

src/unstructured_client/general.py

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def do_request():
4545
'5xx'
4646
]))
4747
content_type = http_res.headers.get('Content-Type')
48-
48+
4949
res = operations.PartitionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
5050

5151
if http_res.status_code == 200:

src/unstructured_client/models/__init__.py

100755100644
File mode changed.

src/unstructured_client/models/errors/__init__.py

100755100644
+1-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
from .httpvalidationerror import *
44
from .sdkerror import *
5-
from .validationerror import *
65

7-
__all__ = ["HTTPValidationError","SDKError","ValidationError"]
6+
__all__ = ["HTTPValidationError","SDKError"]

src/unstructured_client/models/errors/httpvalidationerror.py

100755100644
+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44
import dataclasses
5-
from .validationerror import ValidationError
5+
from ...models.shared import validationerror as shared_validationerror
66
from dataclasses_json import Undefined, dataclass_json
77
from typing import List, Optional
88
from unstructured_client import utils
@@ -12,7 +12,7 @@
1212

1313
@dataclasses.dataclass
1414
class HTTPValidationError(Exception):
15-
detail: Optional[List[ValidationError]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detail'), 'exclude': lambda f: f is None }})
15+
detail: Optional[List[shared_validationerror.ValidationError]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detail'), 'exclude': lambda f: f is None }})
1616

1717

1818
def __str__(self) -> str:

src/unstructured_client/models/errors/sdkerror.py

100755100644
File mode changed.

src/unstructured_client/models/operations/__init__.py

100755100644
File mode changed.

src/unstructured_client/models/operations/partition.py

100755100644
+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
class PartitionResponse:
1111
content_type: str = dataclasses.field()
1212
r"""HTTP response content type for this operation"""
13+
raw_response: requests_http.Response = dataclasses.field()
14+
r"""Raw HTTP response; suitable for custom response parsing"""
1315
status_code: int = dataclasses.field()
1416
r"""HTTP response status code for this operation"""
1517
elements: Optional[List[Any]] = dataclasses.field(default=None)
1618
r"""Successful Response"""
17-
raw_response: Optional[requests_http.Response] = dataclasses.field(default=None)
18-
r"""Raw HTTP response; suitable for custom response parsing"""
1919

2020

src/unstructured_client/models/shared/__init__.py

100755100644
+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
from .partition_parameters import *
44
from .security import *
5+
from .validationerror import *
56

6-
__all__ = ["Files","PartitionParameters","Security"]
7+
__all__ = ["Files","PartitionParameters","Security","ValidationError"]

src/unstructured_client/models/shared/partition_parameters.py

100755100644
File mode changed.

src/unstructured_client/models/shared/security.py

100755100644
File mode changed.

src/unstructured_client/sdk.py

100755100644
File mode changed.

src/unstructured_client/sdkconfiguration.py

100755100644
+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class SDKConfiguration:
2727
server: str = ''
2828
language: str = 'python'
2929
openapi_doc_version: str = '0.0.1'
30-
sdk_version: str = '0.14.0'
31-
gen_version: str = '2.185.0'
32-
user_agent: str = 'speakeasy-sdk/python 0.14.0 2.185.0 0.0.1 unstructured-client'
30+
sdk_version: str = '0.14.3'
31+
gen_version: str = '2.195.2'
32+
user_agent: str = 'speakeasy-sdk/python 0.14.3 2.195.2 0.0.1 unstructured-client'
3333
retry_config: RetryConfig = None
3434

3535
def get_server_details(self) -> Tuple[str, Dict[str, str]]:

src/unstructured_client/utils/__init__.py

100755100644
File mode changed.

src/unstructured_client/utils/retries.py

100755100644
File mode changed.

src/unstructured_client/utils/utils.py

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ def marshal_json(val, encoder=None):
705705

706706
val = json_dict["res"] if encoder is None else encoder(json_dict["res"])
707707

708-
return json.dumps(val)
708+
return json.dumps(val, separators=(',', ':'), sort_keys=True)
709709

710710

711711
def match_content_type(content_type: str, pattern: str) -> boolean:

tests/helpers.py

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+
3+
import re
4+
5+
6+
def sort_query_parameters(url):
7+
parts = url.split("?")
8+
9+
if len(parts) == 1:
10+
return url
11+
12+
query = parts[1]
13+
params = query.split("&")
14+
15+
params.sort(key=lambda x: x.split('=')[0])
16+
17+
return parts[0] + "?" + "&".join(params)
18+
19+
20+
def sort_serialized_maps(inp: any, regex: str, delim: str):
21+
22+
def sort_map(m):
23+
entire_match = m.group(0)
24+
25+
groups = m.groups()
26+
27+
for group in groups:
28+
pairs = []
29+
if '=' in group:
30+
pairs = group.split(delim)
31+
32+
pairs.sort(key=lambda x: x.split('=')[0])
33+
else:
34+
values = group.split(delim)
35+
36+
if len(values) == 1:
37+
pairs = values
38+
else:
39+
pairs = [''] * int(len(values)/2)
40+
# loop though every 2nd item
41+
for i in range(0, len(values), 2):
42+
pairs[int(i/2)] = values[i] + delim + values[i+1]
43+
44+
pairs.sort(key=lambda x: x.split(delim)[0])
45+
46+
entire_match = entire_match.replace(group, delim.join(pairs))
47+
48+
return entire_match
49+
50+
if isinstance(inp, str):
51+
return re.sub(regex, sort_map, inp)
52+
elif isinstance(inp, list):
53+
for i, v in enumerate(inp):
54+
inp[i] = sort_serialized_maps(v, regex, delim)
55+
return inp
56+
elif isinstance(inp, dict):
57+
for k, v in inp.items():
58+
inp[k] = sort_serialized_maps(v, regex, delim)
59+
return inp
60+
else:
61+
raise Exception("Unsupported type")

0 commit comments

Comments
 (0)