Skip to content

Commit

Permalink
Generate newest code from openapi.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
bundesbot authored and bundesbot committed Feb 19, 2022
1 parent bf99b52 commit 47fbccd
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 17 deletions.
2 changes: 1 addition & 1 deletion python-client/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.0-SNAPSHOT
6.0.0-SNAPSHOT
45 changes: 45 additions & 0 deletions python-client/deutschland/mudab/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ def list_mess_stationen(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -418,6 +422,7 @@ def list_mess_stationen(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_mess_stationen_endpoint.call_with_http_info(**kwargs)
Expand Down Expand Up @@ -450,6 +455,10 @@ def list_parameter(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -469,6 +478,7 @@ def list_parameter(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_parameter_endpoint.call_with_http_info(**kwargs)
Expand Down Expand Up @@ -501,6 +511,10 @@ def list_parameter_values(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -520,6 +534,7 @@ def list_parameter_values(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_parameter_values_endpoint.call_with_http_info(**kwargs)
Expand Down Expand Up @@ -552,6 +567,10 @@ def list_parameters_biologie(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -571,6 +590,7 @@ def list_parameters_biologie(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_parameters_biologie_endpoint.call_with_http_info(**kwargs)
Expand Down Expand Up @@ -603,6 +623,10 @@ def list_parameters_biota(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -622,6 +646,7 @@ def list_parameters_biota(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_parameters_biota_endpoint.call_with_http_info(**kwargs)
Expand Down Expand Up @@ -654,6 +679,10 @@ def list_parameters_sediment(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -673,6 +702,7 @@ def list_parameters_sediment(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_parameters_sediment_endpoint.call_with_http_info(**kwargs)
Expand Down Expand Up @@ -705,6 +735,10 @@ def list_parameters_wasser(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -724,6 +758,7 @@ def list_parameters_wasser(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_parameters_wasser_endpoint.call_with_http_info(**kwargs)
Expand Down Expand Up @@ -756,6 +791,10 @@ def list_plc_stations(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -775,6 +814,7 @@ def list_plc_stations(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_plc_stations_endpoint.call_with_http_info(**kwargs)
Expand Down Expand Up @@ -807,6 +847,10 @@ def list_projekt_stationen(self, **kwargs):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
Expand All @@ -826,6 +870,7 @@ def list_projekt_stationen(self, **kwargs):
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
return self.list_projekt_stationen_endpoint.call_with_http_info(**kwargs)
8 changes: 5 additions & 3 deletions python-client/deutschland/mudab/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ def __init__(
"_check_input_type",
"_check_return_type",
"_content_type",
"_spec_property_naming",
]
)
self.params_map["nullable"].extend(["_request_timeout"])
Expand All @@ -777,6 +778,7 @@ def __init__(
"_return_http_data_only": (bool,),
"_check_input_type": (bool,),
"_check_return_type": (bool,),
"_spec_property_naming": (bool,),
"_content_type": (none_type, str),
}
self.openapi_types.update(extra_types)
Expand Down Expand Up @@ -809,7 +811,7 @@ def __validate_inputs(self, kwargs):
value,
self.openapi_types[key],
[key],
False,
kwargs["_spec_property_naming"],
kwargs["_check_input_type"],
configuration=self.api_client.configuration,
)
Expand Down Expand Up @@ -838,12 +840,12 @@ def __gather_params(self, kwargs):
if param_location == "form" and self.openapi_types[param_name] == (
file_type,
):
params["file"][param_name] = [param_value]
params["file"][base_name] = [param_value]
elif param_location == "form" and self.openapi_types[param_name] == (
[file_type],
):
# param_value is already a list
params["file"][param_name] = param_value
params["file"][base_name] = param_value
elif param_location in {"form", "query"}:
param_value_full = (base_name, param_value)
params[param_location].append(param_value_full)
Expand Down
2 changes: 1 addition & 1 deletion python-client/deutschland/mudab/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# reference which would not work in python2
# do not import all models into this module because that uses a lot of memory and stack frames
# if you need the ability to import all models from one package, import them with
# from {{packageName}.models import ModelA, ModelB
# from deutschland.mudab.models import ModelA, ModelB
19 changes: 8 additions & 11 deletions python-client/deutschland/mudab/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,11 @@ def model_to_dict(model_instance, serialize=True):
attribute_map
"""
result = {}
extract_item = (
lambda item: (item[0], model_to_dict(item[1], serialize=serialize))
if hasattr(item[1], "_data_store")
else item
)

model_instances = [model_instance]
if model_instance._composed_schemas:
Expand Down Expand Up @@ -1725,21 +1730,13 @@ def model_to_dict(model_instance, serialize=True):
res.append(v)
elif isinstance(v, ModelSimple):
res.append(v.value)
elif isinstance(v, dict):
res.append(dict(map(extract_item, v.items())))
else:
res.append(model_to_dict(v, serialize=serialize))
result[attr] = res
elif isinstance(value, dict):
result[attr] = dict(
map(
lambda item: (
item[0],
model_to_dict(item[1], serialize=serialize),
)
if hasattr(item[1], "_data_store")
else item,
value.items(),
)
)
result[attr] = dict(map(extract_item, value.items()))
elif isinstance(value, ModelSimple):
result[attr] = value.value
elif hasattr(value, "_data_store"):
Expand Down
2 changes: 1 addition & 1 deletion python-client/sphinx-docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# -- Project information -----------------------------------------------------

project = "mudab-api"
copyright = "2021, BundesAPI"
copyright = "2022, BundesAPI"
author = "BundesAPI"

# The short X.Y version
Expand Down

0 comments on commit 47fbccd

Please sign in to comment.