Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
af1f0f2
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.19.3
speakeasybot Apr 1, 2023
dd8a558
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.19.6
speakeasybot Apr 6, 2023
4ed9bd3
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.19.7
speakeasybot Apr 12, 2023
dcb90e9
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.20.0
speakeasybot Apr 14, 2023
272c9b2
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.20.1
speakeasybot Apr 18, 2023
aa5ed4c
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.20.2
speakeasybot Apr 19, 2023
039ff7d
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.21.4
speakeasybot Apr 21, 2023
271e29b
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.22.1
speakeasybot Apr 22, 2023
b7f82c8
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.23.1
speakeasybot Apr 26, 2023
c41786b
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.25.1
speakeasybot Apr 27, 2023
5dcac03
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.26.2
speakeasybot Apr 28, 2023
9d58280
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.26.4
speakeasybot Apr 29, 2023
00114a1
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.26.5
speakeasybot May 2, 2023
ae7178f
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.27.0
speakeasybot May 3, 2023
5f3dac9
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.29.0
speakeasybot May 5, 2023
d65ff7e
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.29.1
speakeasybot May 6, 2023
0c17c3e
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.29.2
speakeasybot May 10, 2023
cab40fe
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.30.0
speakeasybot May 11, 2023
c98a39b
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.30.1
speakeasybot May 12, 2023
2814eff
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.31.1
speakeasybot May 13, 2023
7efd54f
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.32.0
speakeasybot May 16, 2023
cc55a30
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.33.2
speakeasybot May 17, 2023
6dfc4df
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.34.0
speakeasybot May 18, 2023
8b373c0
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.35.0
speakeasybot May 19, 2023
47541b3
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.37.5
speakeasybot May 23, 2023
c7daf5c
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.39.0
speakeasybot May 27, 2023
54b0caf
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.40.2
speakeasybot Jun 1, 2023
fc6f9ed
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.40.3
speakeasybot Jun 2, 2023
80af79b
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.43.0
speakeasybot Jun 3, 2023
813a00f
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.44.2
speakeasybot Jun 7, 2023
835115d
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.45.0
speakeasybot Jun 8, 2023
e15fcf0
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.45.2
speakeasybot Jun 9, 2023
8c2c46e
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.47.0
speakeasybot Jun 10, 2023
0299995
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.47.1
speakeasybot Jun 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: regenerated with OpenAPI Doc 1.0.0, Speakeay CLI 1.20.0
  • Loading branch information
speakeasybot committed Apr 14, 2023
commit dcb90e9bcbdaddf4d10fc78a8490411b3dc9f60c
8 changes: 7 additions & 1 deletion message/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ Based on:
### Changes
Based on:
- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml
- Speakeasy CLI 1.19.7 (2.17.9) https://github.com/speakeasy-api/speakeasy
- Speakeasy CLI 1.19.7 (2.17.9) https://github.com/speakeasy-api/speakeasy

## 2023-04-14 00:58:46
### Changes
Based on:
- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml
- Speakeasy CLI 1.20.0 (2.18.0) https://github.com/speakeasy-api/speakeasy
6 changes: 3 additions & 3 deletions message/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ configVersion: 1.0.0
management:
docChecksum: 007d70cb5b2af152bc8b6492cdc0171c
docVersion: 1.0.0
speakeasyVersion: 1.19.7
generationVersion: 2.17.9
speakeasyVersion: 1.20.0
generationVersion: 2.18.0
generation:
telemetryEnabled: false
sdkClassName: epilot
sdkFlattening: false
singleTagPerOp: false
python:
version: 1.3.1
version: 1.4.0
author: epilot
description: Python Client SDK for Epilot
packageName: epilot-message
1 change: 1 addition & 0 deletions message/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ disable=raw-checker-failed,
using-constant-test,
too-many-statements,
cyclic-import,
too-many-nested-blocks

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
2 changes: 1 addition & 1 deletion message/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="epilot-message",
version="1.3.1",
version="1.4.0",
author="epilot",
description="Python Client SDK for Epilot",
long_description=long_description,
Expand Down
4 changes: 2 additions & 2 deletions message/src/epilot/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class Epilot:
_security_client: requests_http.Session
_server_url: str = SERVERS[0]
_language: str = "python"
_sdk_version: str = "1.3.1"
_gen_version: str = "2.17.9"
_sdk_version: str = "1.4.0"
_gen_version: str = "2.18.0"

def __init__(self,
security: shared.Security = None,
Expand Down
127 changes: 70 additions & 57 deletions message/src/epilot/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,62 +152,71 @@ def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass
if param_metadata is None:
continue

if param_metadata.get('style', 'simple') == 'simple':
param = getattr(
path_params, field.name) if path_params is not None else None
param = _populate_from_globals(
field.name, param, 'pathParam', gbls)
param = getattr(
path_params, field.name) if path_params is not None else None
param = _populate_from_globals(
field.name, param, 'pathParam', gbls)

if param is None:
continue

if isinstance(param, list):
pp_vals: list[str] = []
for pp_val in param:
if pp_val is None:
continue
pp_vals.append(_val_to_string(pp_val))
path = path.replace(
'{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1)
elif isinstance(param, dict):
pp_vals: list[str] = []
for pp_key in param:
if param[pp_key] is None:
continue
if param_metadata.get('explode'):
pp_vals.append(
f"{pp_key}={_val_to_string(param[pp_key])}")
else:
pp_vals.append(
f"{pp_key},{_val_to_string(param[pp_key])}")
path = path.replace(
'{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1)
elif not isinstance(param, (str, int, float, complex, bool)):
pp_vals: list[str] = []
param_fields: Tuple[Field, ...] = fields(param)
for param_field in param_fields:
param_value_metadata = param_field.metadata.get(
'path_param')
if not param_value_metadata:
continue

parm_name = param_value_metadata.get(
'field_name', field.name)
if param is None:
continue

param_field_val = getattr(param, param_field.name)
if param_field_val is None:
continue
if param_metadata.get('explode'):
pp_vals.append(
f"{parm_name}={_val_to_string(param_field_val)}")
else:
pp_vals.append(
f"{parm_name},{_val_to_string(param_field_val)}")
path = path.replace(
'{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1)
else:
f_name = param_metadata.get("field_name", field.name)
serialization = param_metadata.get('serialization', '')
if serialization != '':
serialized_params = _get_serialized_params(
param_metadata, f_name, param)
for key, value in serialized_params.items():
path = path.replace(
'{' + param_metadata.get('field_name', field.name) + '}', _val_to_string(param), 1)
'{' + key + '}', value, 1)
else:
if param_metadata.get('style', 'simple') == 'simple':
if isinstance(param, list):
pp_vals: list[str] = []
for pp_val in param:
if pp_val is None:
continue
pp_vals.append(_val_to_string(pp_val))
path = path.replace(
'{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1)
elif isinstance(param, dict):
pp_vals: list[str] = []
for pp_key in param:
if param[pp_key] is None:
continue
if param_metadata.get('explode'):
pp_vals.append(
f"{pp_key}={_val_to_string(param[pp_key])}")
else:
pp_vals.append(
f"{pp_key},{_val_to_string(param[pp_key])}")
path = path.replace(
'{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1)
elif not isinstance(param, (str, int, float, complex, bool)):
pp_vals: list[str] = []
param_fields: Tuple[Field, ...] = fields(param)
for param_field in param_fields:
param_value_metadata = param_field.metadata.get(
'path_param')
if not param_value_metadata:
continue

parm_name = param_value_metadata.get(
'field_name', field.name)

param_field_val = getattr(param, param_field.name)
if param_field_val is None:
continue
if param_metadata.get('explode'):
pp_vals.append(
f"{parm_name}={_val_to_string(param_field_val)}")
else:
pp_vals.append(
f"{parm_name},{_val_to_string(param_field_val)}")
path = path.replace(
'{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1)
else:
path = path.replace(
'{' + param_metadata.get('field_name', field.name) + '}', _val_to_string(param), 1)

return server_url.removesuffix("/") + path

Expand Down Expand Up @@ -246,8 +255,12 @@ def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[
f_name = metadata.get("field_name")
serialization = metadata.get('serialization', '')
if serialization != '':
params = params | _get_serialized_query_params(
metadata, f_name, value)
serialized_parms = _get_serialized_params(metadata, f_name, value)
for key, value in serialized_parms.items():
if key in params:
params[key].extend(value)
else:
params[key] = [value]
else:
style = metadata.get('style', 'form')
if style == 'deepObject':
Expand Down Expand Up @@ -282,8 +295,8 @@ def get_headers(headers_params: dataclass) -> dict[str, str]:
return headers


def _get_serialized_query_params(metadata: dict, field_name: str, obj: any) -> dict[str, list[str]]:
params: dict[str, list[str]] = {}
def _get_serialized_params(metadata: dict, field_name: str, obj: any) -> dict[str, str]:
params: dict[str, str] = {}

serialization = metadata.get('serialization', '')
if serialization == 'json':
Expand Down