Skip to content

Commit 84b5482

Browse files
chore: 🐝 Update SDK - Generate 0.25.6 (#167)
> [!IMPORTANT] > Linting report available at: <https://app.speakeasyapi.dev/org/unstructured/unstructured5xr/linting-report/588d8dad25ed464d6e7356dd4dac9e59> > OpenAPI Change report available at: <https://app.speakeasyapi.dev/org/unstructured/unstructured5xr/changes-report/7f809e2a81539ca75d969167631b3882> # SDK update Based on: - OpenAPI Doc - Speakeasy CLI 1.385.0 (2.407.2) https://github.com/speakeasy-api/speakeasy ## OpenAPI Change Summary No specification changes Co-authored-by: speakeasybot <[email protected]>
1 parent 2cd4093 commit 84b5482

File tree

8 files changed

+104
-42
lines changed

8 files changed

+104
-42
lines changed

Diff for: .speakeasy/gen.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
44
docChecksum: 17bd23e4247d7b65a92813afd1252693
55
docVersion: 1.0.44
6-
speakeasyVersion: 1.361.1
7-
generationVersion: 2.393.4
8-
releaseVersion: 0.25.5
9-
configChecksum: 6b4c1555edde75f4f1e422e49a07c208
6+
speakeasyVersion: 1.385.0
7+
generationVersion: 2.407.2
8+
releaseVersion: 0.25.6
9+
configChecksum: 644542f7a4c35c96247736a612b132b3
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
@@ -15,7 +15,7 @@ features:
1515
python:
1616
additionalDependencies: 0.1.0
1717
constsAndDefaults: 0.1.4
18-
core: 4.8.4
18+
core: 4.8.6
1919
examples: 2.81.3
2020
globalSecurity: 2.83.7
2121
globalSecurityCallbacks: 0.1.0

Diff for: .speakeasy/workflow.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
speakeasyVersion: 1.361.1
1+
speakeasyVersion: 1.385.0
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:403efaa5f402ccbd48b83c579e1d8c14197267223ba67e17ddf9f8b824c78a8e
6-
sourceBlobDigest: sha256:f89c6ba5c02602f9cf8c75d96a69a7fef23f7057cd82e78236557ba51f504e98
5+
sourceRevisionDigest: sha256:a05642179a4388c25aa5ca3d761c2456378bff1ad0b53401e4544a5f6a666a8c
6+
sourceBlobDigest: sha256:82a41fda0e36227f53d789a4dafb7cf900a19bd0588af24419a7adc780a2653a
77
tags:
88
- latest
9-
- main
9+
- release-0.25.x
1010
targets:
1111
unstructured-python:
1212
source: my-source
1313
sourceNamespace: my-source
14-
sourceRevisionDigest: sha256:403efaa5f402ccbd48b83c579e1d8c14197267223ba67e17ddf9f8b824c78a8e
15-
sourceBlobDigest: sha256:f89c6ba5c02602f9cf8c75d96a69a7fef23f7057cd82e78236557ba51f504e98
14+
sourceRevisionDigest: sha256:a05642179a4388c25aa5ca3d761c2456378bff1ad0b53401e4544a5f6a666a8c
15+
sourceBlobDigest: sha256:82a41fda0e36227f53d789a4dafb7cf900a19bd0588af24419a7adc780a2653a
1616
outLocation: /github/workspace/repo
1717
workflow:
1818
workflowVersion: 1.0.0

Diff for: README.md

+21
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,30 @@ This is a Python client for the [Unstructured API](https://docs.unstructured.io/
2727

2828
Please refer to the [Unstructured docs](https://docs.unstructured.io/api-reference/api-services/sdk) for a full guide to using the client.
2929

30+
<!-- Start Summary [summary] -->
31+
## Summary
32+
33+
34+
<!-- End Summary [summary] -->
35+
36+
<!-- Start Table of Contents [toc] -->
37+
## Table of Contents
38+
39+
* [SDK Installation](#sdk-installation)
40+
* [SDK Example Usage](#sdk-example-usage)
41+
* [Available Resources and Operations](#available-resources-and-operations)
42+
* [Retries](#retries)
43+
* [Error Handling](#error-handling)
44+
* [Server Selection](#server-selection)
45+
* [Custom HTTP Client](#custom-http-client)
46+
* [Authentication](#authentication)
47+
<!-- End Table of Contents [toc] -->
48+
3049
<!-- Start SDK Installation [installation] -->
3150
## SDK Installation
3251

52+
The SDK can be installed using the *pip* package manager, with dependencies and metadata stored in the `setup.py` file.
53+
3354
```bash
3455
pip install unstructured-client
3556
```

Diff for: RELEASES.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -644,4 +644,14 @@ Based on:
644644
### Generated
645645
- [python v0.25.5] .
646646
### Releases
647-
- [PyPI v0.25.5] https://pypi.org/project/unstructured-client/0.25.5 - .
647+
- [PyPI v0.25.5] https://pypi.org/project/unstructured-client/0.25.5 - .
648+
649+
## 2024-08-31 16:26:35
650+
### Changes
651+
Based on:
652+
- OpenAPI Doc
653+
- Speakeasy CLI 1.385.0 (2.407.2) https://github.com/speakeasy-api/speakeasy
654+
### Generated
655+
- [python v0.25.6] .
656+
### Releases
657+
- [PyPI v0.25.6] https://pypi.org/project/unstructured-client/0.25.6 - .

Diff for: pylintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ disable=raw-checker-failed,
442442
too-many-boolean-expressions,
443443
no-else-raise,
444444
bare-except,
445-
broad-exception-caught
445+
broad-exception-caught,
446+
too-many-return-statements
446447

447448
# Enable the message, report, category or checker with the given id(s). You can
448449
# either give multiple identifier separated by comma (,) or put this option

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
setuptools.setup(
2121
name='unstructured-client',
22-
version='0.25.5',
22+
version='0.25.6',
2323
author='Unstructured',
2424
description='Python Client SDK for Unstructured API',
2525
license = 'MIT',

Diff for: src/unstructured_client/sdkconfiguration.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class SDKConfiguration:
3232
server: Optional[str] = ''
3333
language: str = 'python'
3434
openapi_doc_version: str = '1.0.44'
35-
sdk_version: str = '0.25.5'
36-
gen_version: str = '2.393.4'
37-
user_agent: str = 'speakeasy-sdk/python 0.25.5 2.393.4 1.0.44 unstructured-client'
35+
sdk_version: str = '0.25.6'
36+
gen_version: str = '2.407.2'
37+
user_agent: str = 'speakeasy-sdk/python 0.25.6 2.407.2 1.0.44 unstructured-client'
3838
retry_config: Optional[RetryConfig] = None
3939

4040
def __post_init__(self):

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

+55-25
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def _populate_path_params(
218218
if isinstance(param, List):
219219
pp_vals: List[str] = []
220220
for pp_val in param:
221-
if pp_val is None:
221+
if pp_val is None or pp_val == "__SPEAKEASY_UNSET__":
222222
continue
223223
pp_vals.append(_val_to_string(pp_val))
224224
path_param_values[param_metadata.get("field_name", field.name)] = (
@@ -227,7 +227,10 @@ def _populate_path_params(
227227
elif isinstance(param, Dict):
228228
pp_vals: List[str] = []
229229
for pp_key in param:
230-
if param[pp_key] is None:
230+
if (
231+
param[pp_key] is None
232+
or param[pp_key] == "__SPEAKEASY_UNSET__"
233+
):
231234
continue
232235
if param_metadata.get("explode"):
233236
pp_vals.append(f"{pp_key}={_val_to_string(param[pp_key])}")
@@ -247,7 +250,10 @@ def _populate_path_params(
247250
param_name = param_value_metadata.get("field_name", field.name)
248251

249252
param_field_val = getattr(param, param_field.name)
250-
if param_field_val is None:
253+
if (
254+
param_field_val is None
255+
or param_field_val == "__SPEAKEASY_UNSET__"
256+
):
251257
continue
252258
if param_metadata.get("explode"):
253259
pp_vals.append(
@@ -406,19 +412,23 @@ def _get_serialized_params(
406412
def _populate_deep_object_query_params(
407413
metadata: Dict, field_name: str, obj: Any, params: Dict[str, List[str]]
408414
):
409-
if obj is None:
415+
if obj is None or obj == "__SPEAKEASY_UNSET__":
410416
return
411417

412418
if is_dataclass(obj):
413-
_populate_deep_object_query_params_dataclass(metadata.get("field_name", field_name), obj, params)
419+
_populate_deep_object_query_params_dataclass(
420+
metadata.get("field_name", field_name), obj, params
421+
)
414422
elif isinstance(obj, Dict):
415-
_populate_deep_object_query_params_dict(metadata.get("field_name", field_name), obj, params)
423+
_populate_deep_object_query_params_dict(
424+
metadata.get("field_name", field_name), obj, params
425+
)
416426

417427

418428
def _populate_deep_object_query_params_dataclass(
419429
prior_params_key: str, obj: Any, params: Dict[str, List[str]]
420430
):
421-
if obj is None:
431+
if obj is None or obj == "__SPEAKEASY_UNSET__":
422432
return
423433

424434
if not is_dataclass(obj):
@@ -431,7 +441,7 @@ def _populate_deep_object_query_params_dataclass(
431441
continue
432442

433443
obj_val = getattr(obj, obj_field.name)
434-
if obj_val is None:
444+
if obj_val is None or obj_val == "__SPEAKEASY_UNSET__":
435445
continue
436446

437447
params_key = f'{prior_params_key}[{obj_param_metadata.get("field_name", obj_field.name)}]'
@@ -449,14 +459,14 @@ def _populate_deep_object_query_params_dataclass(
449459
def _populate_deep_object_query_params_dict(
450460
prior_params_key: str, value: Dict, params: Dict[str, List[str]]
451461
):
452-
if value is None:
462+
if value is None or value == "__SPEAKEASY_UNSET__":
453463
return
454464

455465
for key, val in value.items():
456-
if val is None:
466+
if val is None or val == "__SPEAKEASY_UNSET__":
457467
continue
458468

459-
params_key = f'{prior_params_key}[{key}]'
469+
params_key = f"{prior_params_key}[{key}]"
460470

461471
if is_dataclass(val):
462472
_populate_deep_object_query_params_dataclass(params_key, val, params)
@@ -471,11 +481,11 @@ def _populate_deep_object_query_params_dict(
471481
def _populate_deep_object_query_params_list(
472482
params_key: str, value: List, params: Dict[str, List[str]]
473483
):
474-
if value is None:
484+
if value is None or value == "__SPEAKEASY_UNSET__":
475485
return
476486

477487
for val in value:
478-
if val is None:
488+
if val is None or val == "__SPEAKEASY_UNSET__":
479489
continue
480490

481491
if params.get(params_key) is None:
@@ -593,7 +603,7 @@ def serialize_multipart_form(
593603

594604
for field in request_fields:
595605
val = getattr(request, field.name)
596-
if val is None:
606+
if val is None or val == "__SPEAKEASY_UNSET__":
597607
continue
598608

599609
field_metadata = field.metadata.get("multipart_form")
@@ -631,10 +641,12 @@ def serialize_multipart_form(
631641
field_name = field_metadata.get("field_name", field.name)
632642
if isinstance(val, List):
633643
for value in val:
634-
if value is None:
644+
if value is None or value == "__SPEAKEASY_UNSET__":
635645
continue
636646
form.append([field_name + "[]", [None, _val_to_string(value)]])
637647
else:
648+
if val == "__SPEAKEASY_UNSET__":
649+
continue
638650
form.append([field_name, [None, _val_to_string(val)]])
639651
return media_type, None, form
640652

@@ -667,7 +679,7 @@ def serialize_form_data(field_name: str, data: Any) -> Dict[str, Any]:
667679
if is_dataclass(data):
668680
for field in fields(data):
669681
val = getattr(data, field.name)
670-
if val is None:
682+
if val is None or val == "__SPEAKEASY_UNSET__":
671683
continue
672684

673685
metadata = field.metadata.get("form")
@@ -692,6 +704,8 @@ def serialize_form_data(field_name: str, data: Any) -> Dict[str, Any]:
692704
raise Exception(f"Invalid form style for field {field.name}")
693705
elif isinstance(data, Dict):
694706
for key, value in data.items():
707+
if value == "__SPEAKEASY_UNSET__":
708+
continue
695709
form[key] = [_val_to_string(value)]
696710
else:
697711
raise Exception(f"Invalid request body type for field {field_name}")
@@ -716,7 +730,7 @@ def _populate_form(
716730
delimiter: str,
717731
form: Dict[str, List[str]],
718732
):
719-
if obj is None:
733+
if obj is None or obj == "__SPEAKEASY_UNSET__":
720734
return form
721735

722736
if is_dataclass(obj):
@@ -729,7 +743,7 @@ def _populate_form(
729743
continue
730744

731745
val = getattr(obj, obj_field.name)
732-
if val is None:
746+
if val is None or val == "__SPEAKEASY_UNSET__":
733747
continue
734748

735749
if explode:
@@ -742,7 +756,7 @@ def _populate_form(
742756
elif isinstance(obj, Dict):
743757
items = []
744758
for key, value in obj.items():
745-
if value is None:
759+
if value is None or value == "__SPEAKEASY_UNSET__":
746760
continue
747761

748762
if explode:
@@ -756,7 +770,7 @@ def _populate_form(
756770
items = []
757771

758772
for value in obj:
759-
if value is None:
773+
if value is None or value == "__SPEAKEASY_UNSET__":
760774
continue
761775

762776
if explode:
@@ -769,13 +783,14 @@ def _populate_form(
769783
if len(items) > 0:
770784
form[field_name] = [delimiter.join([str(item) for item in items])]
771785
else:
772-
form[field_name] = [_val_to_string(obj)]
786+
if obj != "__SPEAKEASY_UNSET__":
787+
form[field_name] = [_val_to_string(obj)]
773788

774789
return form
775790

776791

777792
def _serialize_header(explode: bool, obj: Any) -> str:
778-
if obj is None:
793+
if obj is None or obj == "__SPEAKEASY_UNSET__":
779794
return ""
780795

781796
if is_dataclass(obj):
@@ -792,7 +807,7 @@ def _serialize_header(explode: bool, obj: Any) -> str:
792807
continue
793808

794809
val = getattr(obj, obj_field.name)
795-
if val is None:
810+
if val is None or val == "__SPEAKEASY_UNSET__":
796811
continue
797812

798813
if explode:
@@ -807,7 +822,7 @@ def _serialize_header(explode: bool, obj: Any) -> str:
807822
items = []
808823

809824
for key, value in obj.items():
810-
if value is None:
825+
if value is None or value == "__SPEAKEASY_UNSET__":
811826
continue
812827

813828
if explode:
@@ -822,14 +837,16 @@ def _serialize_header(explode: bool, obj: Any) -> str:
822837
items = []
823838

824839
for value in obj:
825-
if value is None:
840+
if value is None or value == "__SPEAKEASY_UNSET__":
826841
continue
827842

828843
items.append(_val_to_string(value))
829844

830845
if len(items) > 0:
831846
return ",".join(items)
832847
else:
848+
if obj == "__SPEAKEASY_UNSET__":
849+
return ""
833850
return f"{_val_to_string(obj)}"
834851

835852
return ""
@@ -928,6 +945,7 @@ def bigintdecoder(val):
928945
raise ValueError(f"{val} is a float")
929946
return int(val)
930947

948+
931949
def integerstrencoder(optional: bool):
932950
def integerstrencode(val: int):
933951
if optional and val is None:
@@ -1114,3 +1132,15 @@ def remove_suffix(input_string, suffix):
11141132
if suffix and input_string.endswith(suffix):
11151133
return input_string[: -len(suffix)]
11161134
return input_string
1135+
1136+
1137+
def decodeunset(decoder: Optional[Callable] = None):
1138+
def decode(val):
1139+
if val == "__SPEAKEASY_UNSET__":
1140+
return val
1141+
if decoder is None:
1142+
return None
1143+
1144+
return decoder(val)
1145+
1146+
return decode

0 commit comments

Comments
 (0)