Skip to content

Commit 63b9dec

Browse files
committed
ci: regenerated with OpenAPI Doc 2.1.0, Speakeay CLI 1.29.0
1 parent 19679a2 commit 63b9dec

9 files changed

Lines changed: 52 additions & 32 deletions

File tree

files/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ s = codatfiles.CodatFiles(
2222
),
2323
)
2424

25-
2625
req = operations.DownloadFilesRequest(
2726
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
2827
date_='corrupti',

files/RELEASES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,12 @@ Based on:
278278
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
279279
- Speakeasy CLI 1.27.0 (2.24.0) https://github.com/speakeasy-api/speakeasy
280280
### Releases
281-
- [PyPI v0.14.0] https://pypi.org/project/codat-files/0.14.0 - files
281+
- [PyPI v0.14.0] https://pypi.org/project/codat-files/0.14.0 - files
282+
283+
## 2023-05-05 00:01:12
284+
### Changes
285+
Based on:
286+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
287+
- Speakeasy CLI 1.29.0 (2.26.0) https://github.com/speakeasy-api/speakeasy
288+
### Releases
289+
- [PyPI v0.15.0] https://pypi.org/project/codat-files/0.15.0 - files

files/USAGE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ s = codatfiles.CodatFiles(
99
),
1010
)
1111

12-
1312
req = operations.DownloadFilesRequest(
1413
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
1514
date_='corrupti',

files/docs/files/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ s = codatfiles.CodatFiles(
2626
),
2727
)
2828

29-
3029
req = operations.DownloadFilesRequest(
3130
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
3231
date_='provident',
@@ -54,7 +53,6 @@ s = codatfiles.CodatFiles(
5453
),
5554
)
5655

57-
5856
req = operations.ListFilesRequest(
5957
company_id='8a210b68-6988-11ed-a1eb-0242ac120002',
6058
)
@@ -81,7 +79,6 @@ s = codatfiles.CodatFiles(
8179
),
8280
)
8381

84-
8582
req = operations.UploadFilesRequest(
8683
request_body=operations.UploadFilesRequestBody(
8784
content='distinctio'.encode(),

files/gen.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ configVersion: 1.0.0
22
management:
33
docChecksum: 6a385d7f017b50a79d070b3109870d4b
44
docVersion: 2.1.0
5-
speakeasyVersion: 1.27.0
6-
generationVersion: 2.24.0
5+
speakeasyVersion: 1.29.0
6+
generationVersion: 2.26.0
77
generation:
88
telemetryEnabled: false
99
sdkClassName: CodatFiles
1010
singleTagPerOp: false
1111
python:
12-
version: 0.14.0
12+
version: 0.15.0
1313
author: Speakeasy
1414
description: Python Client SDK Generated by Speakeasy
15+
maxMethodParams: 0
1516
packageName: codat-files

files/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name="codat-files",
13-
version="0.14.0",
13+
version="0.15.0",
1414
author="Speakeasy",
1515
description="Python Client SDK Generated by Speakeasy",
1616
long_description=long_description,

files/src/codatfiles/files.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def __init__(self, client: requests_http.Session, security_client: requests_http
2222
self._sdk_version = sdk_version
2323
self._gen_version = gen_version
2424

25+
2526
def download_files(self, request: operations.DownloadFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DownloadFilesResponse:
2627
r"""Download all files for a company
2728
You can specify a date to download specific files for.
@@ -58,6 +59,7 @@ def do_request():
5859

5960
return res
6061

62+
6163
def list_files(self, request: operations.ListFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListFilesResponse:
6264
r"""List all files uploaded by a company
6365
Returns an array of files that have been uploaded for a given company.
@@ -94,6 +96,7 @@ def do_request():
9496

9597
return res
9698

99+
97100
def upload_files(self, request: operations.UploadFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UploadFilesResponse:
98101
r"""Upload files for a company
99102
Upload files

files/src/codatfiles/sdk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class CodatFiles:
2727
_security_client: requests_http.Session
2828
_server_url: str = SERVERS[0]
2929
_language: str = "python"
30-
_sdk_version: str = "0.14.0"
31-
_gen_version: str = "2.24.0"
30+
_sdk_version: str = "0.15.0"
31+
_gen_version: str = "2.26.0"
3232

3333
def __init__(self,
3434
security: shared.Security = None,

files/src/codatfiles/utils/utils.py

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ def _parse_basic_auth_scheme(client: SecurityClient, scheme: dataclass):
141141
client.client.headers['Authorization'] = f'Basic {base64.b64encode(data).decode()}'
142142

143143

144-
def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass, gbls: dict[str, dict[str, dict[str, Any]]] = None) -> str:
144+
def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass,
145+
gbls: dict[str, dict[str, dict[str, Any]]] = None) -> str:
145146
path_param_fields: Tuple[Field, ...] = fields(clazz)
146147
for field in path_param_fields:
147148
request_metadata = field.metadata.get('request')
@@ -233,7 +234,8 @@ def template_url(url_with_params: str, params: dict[str, str]) -> str:
233234
return url_with_params
234235

235236

236-
def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[str, dict[str, Any]]] = None) -> dict[str, list[str]]:
237+
def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[str, dict[str, Any]]] = None) -> dict[
238+
str, list[str]]:
237239
params: dict[str, list[str]] = {}
238240

239241
param_fields: Tuple[Field, ...] = fields(clazz)
@@ -267,8 +269,11 @@ def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[
267269
params = params | _get_deep_object_query_params(
268270
metadata, f_name, value)
269271
elif style == 'form':
270-
params = params | _get_form_query_params(
271-
metadata, f_name, value)
272+
params = params | _get_delimited_query_params(
273+
metadata, f_name, value, ",")
274+
elif style == 'pipeDelimited':
275+
params = params | _get_delimited_query_params(
276+
metadata, f_name, value, "|")
272277
else:
273278
raise Exception('not yet implemented')
274279
return params
@@ -327,12 +332,15 @@ def _get_deep_object_query_params(metadata: dict, field_name: str, obj: any) ->
327332
if val is None:
328333
continue
329334

330-
if params.get(f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]') is None:
331-
params[f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [
335+
if params.get(
336+
f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]') is None:
337+
params[
338+
f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [
332339
]
333340

334341
params[
335-
f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'].append(_val_to_string(val))
342+
f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'].append(
343+
_val_to_string(val))
336344
else:
337345
params[
338346
f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [
@@ -368,25 +376,28 @@ def _get_query_param_field_name(obj_field: Field) -> str:
368376
return obj_param_metadata.get("field_name", obj_field.name)
369377

370378

371-
def _get_form_query_params(metadata: dict, field_name: str, obj: any) -> dict[str, list[str]]:
372-
return _populate_form(field_name, metadata.get("explode", True), obj, _get_query_param_field_name)
379+
def _get_delimited_query_params(metadata: dict, field_name: str, obj: any, array_delimiter: str) -> dict[
380+
str, list[str]]:
381+
return _populate_form(field_name, metadata.get("explode", True), obj, _get_query_param_field_name, array_delimiter)
373382

374383

375384
SERIALIZATION_METHOD_TO_CONTENT_TYPE = {
376-
'json': 'application/json',
377-
'form': 'application/x-www-form-urlencoded',
385+
'json': 'application/json',
386+
'form': 'application/x-www-form-urlencoded',
378387
'multipart': 'multipart/form-data',
379-
'raw': 'application/octet-stream',
380-
'string': 'text/plain',
388+
'raw': 'application/octet-stream',
389+
'string': 'text/plain',
381390
}
382391

383392

384-
def serialize_request_body(request: dataclass, request_field_name: str, serialization_method: str) -> Tuple[str, any, any]:
393+
def serialize_request_body(request: dataclass, request_field_name: str, serialization_method: str) -> Tuple[
394+
str, any, any]:
385395
if request is None:
386396
return None, None, None, None
387397

388398
if not is_dataclass(request) or not hasattr(request, request_field_name):
389-
return serialize_content_type(request_field_name, SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], request)
399+
return serialize_content_type(request_field_name, SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method],
400+
request)
390401

391402
request_val = getattr(request, request_field_name)
392403

@@ -401,7 +412,8 @@ def serialize_request_body(request: dataclass, request_field_name: str, serializ
401412
if request_metadata is None:
402413
raise Exception('invalid request type')
403414

404-
return serialize_content_type(request_field_name, request_metadata.get('media_type', 'application/octet-stream'), request_val)
415+
return serialize_content_type(request_field_name, request_metadata.get('media_type', 'application/octet-stream'),
416+
request_val)
405417

406418

407419
def serialize_content_type(field_name: str, media_type: str, request: dataclass) -> Tuple[str, any, list[list[any]]]:
@@ -474,7 +486,7 @@ def serialize_multipart_form(media_type: str, request: dataclass) -> Tuple[str,
474486

475487

476488
def serialize_dict(original: dict, explode: bool, field_name, existing: Optional[dict[str, list[str]]]) -> dict[
477-
str, list[str]]:
489+
str, list[str]]:
478490
if existing is None:
479491
existing = []
480492

@@ -514,7 +526,7 @@ def serialize_form_data(field_name: str, data: dataclass) -> dict[str, any]:
514526
else:
515527
if metadata.get('style', 'form') == 'form':
516528
form = form | _populate_form(
517-
field_name, metadata.get('explode', True), val, _get_form_field_name)
529+
field_name, metadata.get('explode', True), val, _get_form_field_name, ",")
518530
else:
519531
raise Exception(
520532
f'Invalid form style for field {field.name}')
@@ -536,7 +548,8 @@ def _get_form_field_name(obj_field: Field) -> str:
536548
return obj_param_metadata.get("field_name", obj_field.name)
537549

538550

539-
def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_func: Callable) -> dict[str, list[str]]:
551+
def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_func: Callable, array_delimiter: str) -> \
552+
dict[str, list[str]]:
540553
params: dict[str, list[str]] = {}
541554

542555
if obj is None:
@@ -591,7 +604,7 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f
591604
items.append(_val_to_string(value))
592605

593606
if len(items) > 0:
594-
params[field_name] = [','.join([str(item) for item in items])]
607+
params[field_name] = [array_delimiter.join([str(item) for item in items])]
595608
else:
596609
params[field_name] = [_val_to_string(obj)]
597610

0 commit comments

Comments
 (0)