Skip to content

Commit 712aa0f

Browse files
chore: 🐝 Update SDK - Generate 0.26.0 (#189)
> [!IMPORTANT] > Linting report available at: <https://app.speakeasy.com/org/unstructured/unstructured5xr/linting-report/54d2969d50cec672efcb4eeb82f2a532> > OpenAPI Change report available at: <https://app.speakeasy.com/org/unstructured/unstructured5xr/changes-report/4e33349131a3a8e181dfda0cf3dbc7b2> # SDK update Based on: - OpenAPI Doc - Speakeasy CLI 1.410.0 (2.434.1) https://github.com/speakeasy-api/speakeasy ## OpenAPI Change Summary No specification changes Co-authored-by: speakeasybot <[email protected]>
1 parent f6c6247 commit 712aa0f

File tree

13 files changed

+63
-26
lines changed

13 files changed

+63
-26
lines changed

Diff for: .speakeasy/gen.lock

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
44
docChecksum: 21f469b38bb72725739ee9d9d0fc8780
55
docVersion: 1.0.51
6-
speakeasyVersion: 1.405.6
7-
generationVersion: 2.428.1
8-
releaseVersion: 0.26.0-beta.4
9-
configChecksum: 0b79ec3eb6db29cf265da8359efa5611
6+
speakeasyVersion: 1.410.0
7+
generationVersion: 2.434.1
8+
releaseVersion: 0.26.0
9+
configChecksum: 0916704b547a0697b2ccf93c0d4becac
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1313
published: true
1414
features:
1515
python:
1616
additionalDependencies: 1.0.0
17-
constsAndDefaults: 1.0.3
18-
core: 5.5.7
17+
constsAndDefaults: 1.0.4
18+
core: 5.5.8
1919
defaultEnabledRetries: 0.2.0
2020
enumUnions: 0.1.0
2121
envVarSecurityUsage: 0.3.1
@@ -36,6 +36,7 @@ features:
3636
uploadStreams: 1.0.0
3737
generatedFiles:
3838
- .gitattributes
39+
- .python-version
3940
- .vscode/settings.json
4041
- CONTRIBUTING.md
4142
- USAGE.md

Diff for: .speakeasy/workflow.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
speakeasyVersion: 1.405.6
1+
speakeasyVersion: 1.410.0
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:e3464d52f2e61a998b54643c076678c5fd4239186074f29643d5703366dedd85
5+
sourceRevisionDigest: sha256:4587b07d95e133a5fe806b02e4b82bb9e268499adeaa299139edf722073f5bb1
66
sourceBlobDigest: sha256:27e4879df402e924f9f65d336ea6d2fc8b16a00b87b4a802866238f7e9f639d3
77
tags:
88
- latest
@@ -11,7 +11,7 @@ targets:
1111
unstructured-python:
1212
source: my-source
1313
sourceNamespace: my-source
14-
sourceRevisionDigest: sha256:e3464d52f2e61a998b54643c076678c5fd4239186074f29643d5703366dedd85
14+
sourceRevisionDigest: sha256:4587b07d95e133a5fe806b02e4b82bb9e268499adeaa299139edf722073f5bb1
1515
sourceBlobDigest: sha256:27e4879df402e924f9f65d336ea6d2fc8b16a00b87b4a802866238f7e9f639d3
1616
workflow:
1717
workflowVersion: 1.0.0

Diff for: README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,24 @@ if res.elements is not None:
137137
<!-- Start Error Handling [errors] -->
138138
## Error Handling
139139

140-
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
140+
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
141141

142-
| Error Object | Status Code | Content Type |
142+
By default, an API error will raise a errors.SDKError exception, which has the following properties:
143+
144+
| Property | Type | Description |
145+
|-----------------|------------------|-----------------------|
146+
| `.status_code` | *int* | The HTTP status code |
147+
| `.message` | *str* | The error message |
148+
| `.raw_response` | *httpx.Response* | The raw HTTP response |
149+
| `.body` | *str* | The response content |
150+
151+
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `partition_async` method may raise the following exceptions:
152+
153+
| Error Type | Status Code | Content Type |
143154
| -------------------------- | -------------------------- | -------------------------- |
144155
| errors.HTTPValidationError | 422 | application/json |
145156
| errors.ServerError | 5XX | application/json |
146-
| errors.SDKError | 4xx-5xx | */* |
157+
| errors.SDKError | 4XX | \*/\* |
147158

148159
### Example
149160

Diff for: RELEASES.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -684,4 +684,14 @@ Based on:
684684
### Generated
685685
- [python v0.26.0-beta.4] .
686686
### Releases
687-
- [PyPI v0.26.0-beta.4] https://pypi.org/project/unstructured-client/0.26.0-beta.4 - .
687+
- [PyPI v0.26.0-beta.4] https://pypi.org/project/unstructured-client/0.26.0-beta.4 - .
688+
689+
## 2024-10-07 00:09:40
690+
### Changes
691+
Based on:
692+
- OpenAPI Doc
693+
- Speakeasy CLI 1.410.0 (2.434.1) https://github.com/speakeasy-api/speakeasy
694+
### Generated
695+
- [python v0.26.0] .
696+
### Releases
697+
- [PyPI v0.26.0] https://pypi.org/project/unstructured-client/0.26.0 - .

Diff for: gen.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ python:
3333
responseRequiredSep2024: false
3434
flattenGlobalSecurity: true
3535
flattenRequests: false
36+
flatteningOrder: parameters-first
3637
imports:
3738
option: openapi
3839
paths:

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "unstructured-client"
3-
version = "0.26.0-beta.4"
3+
version = "0.26.0"
44
description = "Python Client SDK for Unstructured API"
55
authors = ["Unstructured",]
66
readme = "README-PYPI.md"

Diff for: src/unstructured_client/models/operations/partition.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import httpx
55
import pydantic
66
from pydantic import model_serializer
7-
from typing import Any, Dict, List, Optional, TypedDict
8-
from typing_extensions import Annotated, NotRequired
7+
from typing import Any, Dict, List, Optional
8+
from typing_extensions import Annotated, NotRequired, TypedDict
99
from unstructured_client.models.shared import (
1010
partition_parameters as shared_partition_parameters,
1111
)

Diff for: src/unstructured_client/models/shared/partition_parameters.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import pydantic
77
from pydantic import model_serializer
88
from pydantic.functional_validators import PlainValidator
9-
from typing import IO, List, Optional, TypedDict, Union
10-
from typing_extensions import Annotated, NotRequired
9+
from typing import IO, List, Optional, Union
10+
from typing_extensions import Annotated, NotRequired, TypedDict
1111
from unstructured_client import utils
1212
from unstructured_client.types import (
1313
BaseModel,

Diff for: src/unstructured_client/models/shared/security.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
22

33
from __future__ import annotations
4-
from typing import Optional, TypedDict
5-
from typing_extensions import Annotated, NotRequired
4+
from typing import Optional
5+
from typing_extensions import Annotated, NotRequired, TypedDict
66
from unstructured_client.types import BaseModel
77
from unstructured_client.utils import FieldMetadata, SecurityMetadata
88

Diff for: src/unstructured_client/models/shared/validationerror.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
22

33
from __future__ import annotations
4-
from typing import List, TypedDict, Union
4+
from typing import List, Union
5+
from typing_extensions import TypedDict
56
from unstructured_client.types import BaseModel
67

78

Diff for: src/unstructured_client/sdkconfiguration.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ class SDKConfiguration:
3434
server: Optional[str] = ""
3535
language: str = "python"
3636
openapi_doc_version: str = "1.0.51"
37-
sdk_version: str = "0.26.0-beta.4"
38-
gen_version: str = "2.428.1"
39-
user_agent: str = (
40-
"speakeasy-sdk/python 0.26.0-beta.4 2.428.1 1.0.51 unstructured-client"
41-
)
37+
sdk_version: str = "0.26.0"
38+
gen_version: str = "2.434.1"
39+
user_agent: str = "speakeasy-sdk/python 0.26.0 2.434.1 1.0.51 unstructured-client"
4240
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
4341
timeout_ms: Optional[int] = None
4442

Diff for: src/unstructured_client/utils/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
serialize_float,
2828
serialize_int,
2929
stream_to_text,
30+
validate_const,
3031
validate_decimal,
3132
validate_float,
3233
validate_int,
@@ -83,6 +84,7 @@
8384
"unmarshal",
8485
"unmarshal_json",
8586
"validate_decimal",
87+
"validate_const",
8688
"validate_float",
8789
"validate_int",
8890
"validate_open_enum",

Diff for: src/unstructured_client/utils/serializers.py

+13
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ def validate(e):
116116
return validate
117117

118118

119+
def validate_const(v):
120+
def validate(c):
121+
if is_optional_type(type(c)) and c is None:
122+
return None
123+
124+
if v != c:
125+
raise ValueError(f"Expected {v}")
126+
127+
return c
128+
129+
return validate
130+
131+
119132
def unmarshal_json(raw, typ: Any) -> Any:
120133
return unmarshal(from_json(raw), typ)
121134

0 commit comments

Comments
 (0)