Skip to content

Commit 47fbccd

Browse files
bundesbotbundesbot
authored andcommitted
Generate newest code from openapi.yaml
1 parent bf99b52 commit 47fbccd

6 files changed

Lines changed: 61 additions & 17 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.4.0-SNAPSHOT
1+
6.0.0-SNAPSHOT

python-client/deutschland/mudab/api/default_api.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,10 @@ def list_mess_stationen(self, **kwargs):
399399
_check_return_type (bool): specifies if type checking
400400
should be done one the data received from the server.
401401
Default is True.
402+
_spec_property_naming (bool): True if the variable names in the input data
403+
are serialized names, as specified in the OpenAPI document.
404+
False if the variable names in the input data
405+
are pythonic names, e.g. snake case (default)
402406
_content_type (str/None): force body content-type.
403407
Default is None and content-type will be predicted by allowed
404408
content-types and body.
@@ -418,6 +422,7 @@ def list_mess_stationen(self, **kwargs):
418422
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
419423
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
420424
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
425+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
421426
kwargs["_content_type"] = kwargs.get("_content_type")
422427
kwargs["_host_index"] = kwargs.get("_host_index")
423428
return self.list_mess_stationen_endpoint.call_with_http_info(**kwargs)
@@ -450,6 +455,10 @@ def list_parameter(self, **kwargs):
450455
_check_return_type (bool): specifies if type checking
451456
should be done one the data received from the server.
452457
Default is True.
458+
_spec_property_naming (bool): True if the variable names in the input data
459+
are serialized names, as specified in the OpenAPI document.
460+
False if the variable names in the input data
461+
are pythonic names, e.g. snake case (default)
453462
_content_type (str/None): force body content-type.
454463
Default is None and content-type will be predicted by allowed
455464
content-types and body.
@@ -469,6 +478,7 @@ def list_parameter(self, **kwargs):
469478
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
470479
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
471480
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
481+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
472482
kwargs["_content_type"] = kwargs.get("_content_type")
473483
kwargs["_host_index"] = kwargs.get("_host_index")
474484
return self.list_parameter_endpoint.call_with_http_info(**kwargs)
@@ -501,6 +511,10 @@ def list_parameter_values(self, **kwargs):
501511
_check_return_type (bool): specifies if type checking
502512
should be done one the data received from the server.
503513
Default is True.
514+
_spec_property_naming (bool): True if the variable names in the input data
515+
are serialized names, as specified in the OpenAPI document.
516+
False if the variable names in the input data
517+
are pythonic names, e.g. snake case (default)
504518
_content_type (str/None): force body content-type.
505519
Default is None and content-type will be predicted by allowed
506520
content-types and body.
@@ -520,6 +534,7 @@ def list_parameter_values(self, **kwargs):
520534
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
521535
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
522536
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
537+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
523538
kwargs["_content_type"] = kwargs.get("_content_type")
524539
kwargs["_host_index"] = kwargs.get("_host_index")
525540
return self.list_parameter_values_endpoint.call_with_http_info(**kwargs)
@@ -552,6 +567,10 @@ def list_parameters_biologie(self, **kwargs):
552567
_check_return_type (bool): specifies if type checking
553568
should be done one the data received from the server.
554569
Default is True.
570+
_spec_property_naming (bool): True if the variable names in the input data
571+
are serialized names, as specified in the OpenAPI document.
572+
False if the variable names in the input data
573+
are pythonic names, e.g. snake case (default)
555574
_content_type (str/None): force body content-type.
556575
Default is None and content-type will be predicted by allowed
557576
content-types and body.
@@ -571,6 +590,7 @@ def list_parameters_biologie(self, **kwargs):
571590
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
572591
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
573592
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
593+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
574594
kwargs["_content_type"] = kwargs.get("_content_type")
575595
kwargs["_host_index"] = kwargs.get("_host_index")
576596
return self.list_parameters_biologie_endpoint.call_with_http_info(**kwargs)
@@ -603,6 +623,10 @@ def list_parameters_biota(self, **kwargs):
603623
_check_return_type (bool): specifies if type checking
604624
should be done one the data received from the server.
605625
Default is True.
626+
_spec_property_naming (bool): True if the variable names in the input data
627+
are serialized names, as specified in the OpenAPI document.
628+
False if the variable names in the input data
629+
are pythonic names, e.g. snake case (default)
606630
_content_type (str/None): force body content-type.
607631
Default is None and content-type will be predicted by allowed
608632
content-types and body.
@@ -622,6 +646,7 @@ def list_parameters_biota(self, **kwargs):
622646
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
623647
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
624648
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
649+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
625650
kwargs["_content_type"] = kwargs.get("_content_type")
626651
kwargs["_host_index"] = kwargs.get("_host_index")
627652
return self.list_parameters_biota_endpoint.call_with_http_info(**kwargs)
@@ -654,6 +679,10 @@ def list_parameters_sediment(self, **kwargs):
654679
_check_return_type (bool): specifies if type checking
655680
should be done one the data received from the server.
656681
Default is True.
682+
_spec_property_naming (bool): True if the variable names in the input data
683+
are serialized names, as specified in the OpenAPI document.
684+
False if the variable names in the input data
685+
are pythonic names, e.g. snake case (default)
657686
_content_type (str/None): force body content-type.
658687
Default is None and content-type will be predicted by allowed
659688
content-types and body.
@@ -673,6 +702,7 @@ def list_parameters_sediment(self, **kwargs):
673702
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
674703
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
675704
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
705+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
676706
kwargs["_content_type"] = kwargs.get("_content_type")
677707
kwargs["_host_index"] = kwargs.get("_host_index")
678708
return self.list_parameters_sediment_endpoint.call_with_http_info(**kwargs)
@@ -705,6 +735,10 @@ def list_parameters_wasser(self, **kwargs):
705735
_check_return_type (bool): specifies if type checking
706736
should be done one the data received from the server.
707737
Default is True.
738+
_spec_property_naming (bool): True if the variable names in the input data
739+
are serialized names, as specified in the OpenAPI document.
740+
False if the variable names in the input data
741+
are pythonic names, e.g. snake case (default)
708742
_content_type (str/None): force body content-type.
709743
Default is None and content-type will be predicted by allowed
710744
content-types and body.
@@ -724,6 +758,7 @@ def list_parameters_wasser(self, **kwargs):
724758
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
725759
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
726760
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
761+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
727762
kwargs["_content_type"] = kwargs.get("_content_type")
728763
kwargs["_host_index"] = kwargs.get("_host_index")
729764
return self.list_parameters_wasser_endpoint.call_with_http_info(**kwargs)
@@ -756,6 +791,10 @@ def list_plc_stations(self, **kwargs):
756791
_check_return_type (bool): specifies if type checking
757792
should be done one the data received from the server.
758793
Default is True.
794+
_spec_property_naming (bool): True if the variable names in the input data
795+
are serialized names, as specified in the OpenAPI document.
796+
False if the variable names in the input data
797+
are pythonic names, e.g. snake case (default)
759798
_content_type (str/None): force body content-type.
760799
Default is None and content-type will be predicted by allowed
761800
content-types and body.
@@ -775,6 +814,7 @@ def list_plc_stations(self, **kwargs):
775814
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
776815
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
777816
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
817+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
778818
kwargs["_content_type"] = kwargs.get("_content_type")
779819
kwargs["_host_index"] = kwargs.get("_host_index")
780820
return self.list_plc_stations_endpoint.call_with_http_info(**kwargs)
@@ -807,6 +847,10 @@ def list_projekt_stationen(self, **kwargs):
807847
_check_return_type (bool): specifies if type checking
808848
should be done one the data received from the server.
809849
Default is True.
850+
_spec_property_naming (bool): True if the variable names in the input data
851+
are serialized names, as specified in the OpenAPI document.
852+
False if the variable names in the input data
853+
are pythonic names, e.g. snake case (default)
810854
_content_type (str/None): force body content-type.
811855
Default is None and content-type will be predicted by allowed
812856
content-types and body.
@@ -826,6 +870,7 @@ def list_projekt_stationen(self, **kwargs):
826870
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
827871
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
828872
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
873+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
829874
kwargs["_content_type"] = kwargs.get("_content_type")
830875
kwargs["_host_index"] = kwargs.get("_host_index")
831876
return self.list_projekt_stationen_endpoint.call_with_http_info(**kwargs)

python-client/deutschland/mudab/api_client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ def __init__(
755755
"_check_input_type",
756756
"_check_return_type",
757757
"_content_type",
758+
"_spec_property_naming",
758759
]
759760
)
760761
self.params_map["nullable"].extend(["_request_timeout"])
@@ -777,6 +778,7 @@ def __init__(
777778
"_return_http_data_only": (bool,),
778779
"_check_input_type": (bool,),
779780
"_check_return_type": (bool,),
781+
"_spec_property_naming": (bool,),
780782
"_content_type": (none_type, str),
781783
}
782784
self.openapi_types.update(extra_types)
@@ -809,7 +811,7 @@ def __validate_inputs(self, kwargs):
809811
value,
810812
self.openapi_types[key],
811813
[key],
812-
False,
814+
kwargs["_spec_property_naming"],
813815
kwargs["_check_input_type"],
814816
configuration=self.api_client.configuration,
815817
)
@@ -838,12 +840,12 @@ def __gather_params(self, kwargs):
838840
if param_location == "form" and self.openapi_types[param_name] == (
839841
file_type,
840842
):
841-
params["file"][param_name] = [param_value]
843+
params["file"][base_name] = [param_value]
842844
elif param_location == "form" and self.openapi_types[param_name] == (
843845
[file_type],
844846
):
845847
# param_value is already a list
846-
params["file"][param_name] = param_value
848+
params["file"][base_name] = param_value
847849
elif param_location in {"form", "query"}:
848850
param_value_full = (base_name, param_value)
849851
params[param_location].append(param_value_full)

python-client/deutschland/mudab/model/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# reference which would not work in python2
33
# do not import all models into this module because that uses a lot of memory and stack frames
44
# if you need the ability to import all models from one package, import them with
5-
# from {{packageName}.models import ModelA, ModelB
5+
# from deutschland.mudab.models import ModelA, ModelB

python-client/deutschland/mudab/model_utils.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,6 +1696,11 @@ def model_to_dict(model_instance, serialize=True):
16961696
attribute_map
16971697
"""
16981698
result = {}
1699+
extract_item = (
1700+
lambda item: (item[0], model_to_dict(item[1], serialize=serialize))
1701+
if hasattr(item[1], "_data_store")
1702+
else item
1703+
)
16991704

17001705
model_instances = [model_instance]
17011706
if model_instance._composed_schemas:
@@ -1725,21 +1730,13 @@ def model_to_dict(model_instance, serialize=True):
17251730
res.append(v)
17261731
elif isinstance(v, ModelSimple):
17271732
res.append(v.value)
1733+
elif isinstance(v, dict):
1734+
res.append(dict(map(extract_item, v.items())))
17281735
else:
17291736
res.append(model_to_dict(v, serialize=serialize))
17301737
result[attr] = res
17311738
elif isinstance(value, dict):
1732-
result[attr] = dict(
1733-
map(
1734-
lambda item: (
1735-
item[0],
1736-
model_to_dict(item[1], serialize=serialize),
1737-
)
1738-
if hasattr(item[1], "_data_store")
1739-
else item,
1740-
value.items(),
1741-
)
1742-
)
1739+
result[attr] = dict(map(extract_item, value.items()))
17431740
elif isinstance(value, ModelSimple):
17441741
result[attr] = value.value
17451742
elif hasattr(value, "_data_store"):

python-client/sphinx-docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# -- Project information -----------------------------------------------------
2323

2424
project = "mudab-api"
25-
copyright = "2021, BundesAPI"
25+
copyright = "2022, BundesAPI"
2626
author = "BundesAPI"
2727

2828
# The short X.Y version

0 commit comments

Comments
 (0)