Skip to content

Commit

Permalink
chore: 🐝 Update SDK - Generate 0.26.0 (#189)
Browse files Browse the repository at this point in the history
> [!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]>
  • Loading branch information
github-actions[bot] and speakeasybot authored Oct 7, 2024
1 parent f6c6247 commit 712aa0f
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 26 deletions.
13 changes: 7 additions & 6 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ id: 8b5fa338-9106-4734-abf0-e30d67044a90
management:
docChecksum: 21f469b38bb72725739ee9d9d0fc8780
docVersion: 1.0.51
speakeasyVersion: 1.405.6
generationVersion: 2.428.1
releaseVersion: 0.26.0-beta.4
configChecksum: 0b79ec3eb6db29cf265da8359efa5611
speakeasyVersion: 1.410.0
generationVersion: 2.434.1
releaseVersion: 0.26.0
configChecksum: 0916704b547a0697b2ccf93c0d4becac
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:
additionalDependencies: 1.0.0
constsAndDefaults: 1.0.3
core: 5.5.7
constsAndDefaults: 1.0.4
core: 5.5.8
defaultEnabledRetries: 0.2.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.3.1
Expand All @@ -36,6 +36,7 @@ features:
uploadStreams: 1.0.0
generatedFiles:
- .gitattributes
- .python-version
- .vscode/settings.json
- CONTRIBUTING.md
- USAGE.md
Expand Down
6 changes: 3 additions & 3 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
speakeasyVersion: 1.405.6
speakeasyVersion: 1.410.0
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:e3464d52f2e61a998b54643c076678c5fd4239186074f29643d5703366dedd85
sourceRevisionDigest: sha256:4587b07d95e133a5fe806b02e4b82bb9e268499adeaa299139edf722073f5bb1
sourceBlobDigest: sha256:27e4879df402e924f9f65d336ea6d2fc8b16a00b87b4a802866238f7e9f639d3
tags:
- latest
Expand All @@ -11,7 +11,7 @@ targets:
unstructured-python:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:e3464d52f2e61a998b54643c076678c5fd4239186074f29643d5703366dedd85
sourceRevisionDigest: sha256:4587b07d95e133a5fe806b02e4b82bb9e268499adeaa299139edf722073f5bb1
sourceBlobDigest: sha256:27e4879df402e924f9f65d336ea6d2fc8b16a00b87b4a802866238f7e9f639d3
workflow:
workflowVersion: 1.0.0
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,24 @@ if res.elements is not None:
<!-- Start Error Handling [errors] -->
## Error Handling

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.
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.

| Error Object | Status Code | Content Type |
By default, an API error will raise a errors.SDKError exception, which has the following properties:

| Property | Type | Description |
|-----------------|------------------|-----------------------|
| `.status_code` | *int* | The HTTP status code |
| `.message` | *str* | The error message |
| `.raw_response` | *httpx.Response* | The raw HTTP response |
| `.body` | *str* | The response content |

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:

| Error Type | Status Code | Content Type |
| -------------------------- | -------------------------- | -------------------------- |
| errors.HTTPValidationError | 422 | application/json |
| errors.ServerError | 5XX | application/json |
| errors.SDKError | 4xx-5xx | */* |
| errors.SDKError | 4XX | \*/\* |

### Example

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,4 +684,14 @@ Based on:
### Generated
- [python v0.26.0-beta.4] .
### Releases
- [PyPI v0.26.0-beta.4] https://pypi.org/project/unstructured-client/0.26.0-beta.4 - .
- [PyPI v0.26.0-beta.4] https://pypi.org/project/unstructured-client/0.26.0-beta.4 - .

## 2024-10-07 00:09:40
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.410.0 (2.434.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.26.0] .
### Releases
- [PyPI v0.26.0] https://pypi.org/project/unstructured-client/0.26.0 - .
1 change: 1 addition & 0 deletions gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ python:
responseRequiredSep2024: false
flattenGlobalSecurity: true
flattenRequests: false
flatteningOrder: parameters-first
imports:
option: openapi
paths:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "unstructured-client"
version = "0.26.0-beta.4"
version = "0.26.0"
description = "Python Client SDK for Unstructured API"
authors = ["Unstructured",]
readme = "README-PYPI.md"
Expand Down
4 changes: 2 additions & 2 deletions src/unstructured_client/models/operations/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import httpx
import pydantic
from pydantic import model_serializer
from typing import Any, Dict, List, Optional, TypedDict
from typing_extensions import Annotated, NotRequired
from typing import Any, Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
from unstructured_client.models.shared import (
partition_parameters as shared_partition_parameters,
)
Expand Down
4 changes: 2 additions & 2 deletions src/unstructured_client/models/shared/partition_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import pydantic
from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing import IO, List, Optional, TypedDict, Union
from typing_extensions import Annotated, NotRequired
from typing import IO, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
from unstructured_client import utils
from unstructured_client.types import (
BaseModel,
Expand Down
4 changes: 2 additions & 2 deletions src/unstructured_client/models/shared/security.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from typing import Optional, TypedDict
from typing_extensions import Annotated, NotRequired
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
from unstructured_client.types import BaseModel
from unstructured_client.utils import FieldMetadata, SecurityMetadata

Expand Down
3 changes: 2 additions & 1 deletion src/unstructured_client/models/shared/validationerror.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from typing import List, TypedDict, Union
from typing import List, Union
from typing_extensions import TypedDict
from unstructured_client.types import BaseModel


Expand Down
8 changes: 3 additions & 5 deletions src/unstructured_client/sdkconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ class SDKConfiguration:
server: Optional[str] = ""
language: str = "python"
openapi_doc_version: str = "1.0.51"
sdk_version: str = "0.26.0-beta.4"
gen_version: str = "2.428.1"
user_agent: str = (
"speakeasy-sdk/python 0.26.0-beta.4 2.428.1 1.0.51 unstructured-client"
)
sdk_version: str = "0.26.0"
gen_version: str = "2.434.1"
user_agent: str = "speakeasy-sdk/python 0.26.0 2.434.1 1.0.51 unstructured-client"
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
timeout_ms: Optional[int] = None

Expand Down
2 changes: 2 additions & 0 deletions src/unstructured_client/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
serialize_float,
serialize_int,
stream_to_text,
validate_const,
validate_decimal,
validate_float,
validate_int,
Expand Down Expand Up @@ -83,6 +84,7 @@
"unmarshal",
"unmarshal_json",
"validate_decimal",
"validate_const",
"validate_float",
"validate_int",
"validate_open_enum",
Expand Down
13 changes: 13 additions & 0 deletions src/unstructured_client/utils/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ def validate(e):
return validate


def validate_const(v):
def validate(c):
if is_optional_type(type(c)) and c is None:
return None

if v != c:
raise ValueError(f"Expected {v}")

return c

return validate


def unmarshal_json(raw, typ: Any) -> Any:
return unmarshal(from_json(raw), typ)

Expand Down

0 comments on commit 712aa0f

Please sign in to comment.